On 2023-02-25, Paul Rubin wrote:
> Jon Ribbens writes:
>>> 1) you generally want to use RLock rather than Lock
>> Why?
>
> So that a thread that tries to acquire it twice doesn't block itself,
> etc. Look at the threading lib docs for more info.
Yes, I know what the docs say, I was asking why y
On 2023-02-26, Barry Scott wrote:
> On 25/02/2023 23:45, Jon Ribbens via Python-list wrote:
>> I think it is the case that x += 1 is atomic but foo.x += 1 is not.
>
> No that is not true, and has never been true.
>
>:>>> def x(a):
>:... a += 1
>:...
>
On 2023-02-26, Chris Angelico wrote:
> On Sun, 26 Feb 2023 at 16:16, Jon Ribbens via Python-list
> wrote:
>> On 2023-02-25, Paul Rubin wrote:
>> > The GIL is an evil thing, but it has been around for so long that most
>> > of us have gotten used to it, and some u
On 27/02/23 10:07 pm, Roel Schroeven wrote:
I'm guessing you're thinking about variables leaking out of list
comprehensions. I seem to remember (but I could be wrong) it was a
design mistake rather than a bug in the code, but in any case it's been
fixed now (in the 2 to 3 transition, I think).
Edmondo Giovannozzi wrote:
> Il giorno mercoledì 22 febbraio 2023 alle 09:50:14 UTC+1 Robert Latest ha
> scritto:
>> I found myself building a complicated logical condition with many ands and
>> ors which I made more manageable by putting the various terms on individual
>> lines and breaking them w
Paul Bryan wrote:
> Adding to this, there should be no reason now in recent versions of
> Python to ever use line continuation. Black goes so far as to state
> "backslashes are bad and should never be used":
>
> https://black.readthedocs.io/en/stable/the_black_code_style/
future_style.html#using-
Robert Latest wrote:
> Paul Bryan wrote:
>> Adding to this, there should be no reason now in recent versions of
>> Python to ever use line continuation. Black goes so far as to state
>> "backslashes are bad and should never be used":
>>
>> https://black.readthedocs.io/en/stable/the_black_code_style
When matching a string against a longer string, where both strings have spaces
in them, we need to escape the spaces.
This works (no spaces):
import re
example = 'abcdefabcdefabcdefg'
find_string = "abc"
for match in re.finditer(find_string, example):
print(match.start(), match.end())
Tha
On 28/02/23 7:40 am, [email protected] wrote:
inhahe made the point that this may not have been the
original intent for python and may be a sort of bug that it is too late to fix.
Guido has publically stated that it was a deliberate design choice.
The merits of that design choice can be d
On 28/02/23 5:08 am, Thomas Passin wrote:
On 2/27/2023 11:01 AM, Mats Wichmann wrote:
If you intend to run Black on your code to ensure consistent
formatting, you may as well learn to prefer double quotes, because
it's going to convert single to double
I prefer single quotes because they are
On 27/02/2023 21:04, Ethan Furman wrote:
On 2/27/23 12:20, rbowman wrote:
> "By using Black, you agree to cede control over minutiae of hand-
> formatting. In return, Black gives you speed, determinism, and freedom
> from pycodestyle nagging about formatting. You will save time and
mental
>
Yes, that's it. I don't know how long it would have taken to find that detail
with research through the voluminous re documentation. Thanks very much.
Feb 27, 2023, 15:47 by [email protected]:
> On 2023-02-27 23:11, Jen Kris via Python-list wrote:
>
>>
I went to the re module because the specified string may appear more than once
in the string (in the code I'm writing). For example:
a = "X - abc_degree + 1 + qq + abc_degree + 1"
b = "abc_degree + 1"
q = a.find(b)
print(q)
4
So it correctly finds the start of the first instance, but not
string.count() only tells me there are N instances of the string; it does not
say where they begin and end, as does re.finditer.
Feb 27, 2023, 16:20 by [email protected]:
> Would string.count() work for you then?
>
> On Mon, Feb 27, 2023 at 5:16 PM Jen Kris via Python-list <
I haven't tested it either but it looks like it would work. But for this case
I prefer the relative simplicity of:
example = 'X - abc_degree + 1 + qq + abc_degree + 1'
find_string = re.escape('abc_degree + 1')
for match in re.finditer(find_string, example):
print(match.start(), match.end())
On 28/02/23 4:24 pm, Hen Hanna wrote:
is it poss. to peek at the Python-list's messages
without joining ?
It's mirrored to the comp.lang.python usenet group, or
you can read it through gmane with a news client.
--
Greg
--
https://mail.python.org/mailman/listinfo/py
hings that are far from the same such as matching two
> repeated words of any kind in any case including "and and" and "so so" or
> finding words that have multiple doubled letter as in the stereotypical
> bookkeeper. In those cases, you may want even more than offset
Using str.startswith is a cool idea in this case. But is it better than regex
for performance or reliability? Regex syntax is not a model of simplicity, but
in my simple case it's not too difficult.
Feb 27, 2023, 18:52 by [email protected]:
> On 2/27/2023 9:16 PM, [email protected]
I wrote my previous message before reading this. Thank you for the test you
ran -- it answers the question of performance. You show that re.finditer is
30x faster, so that certainly recommends that over a simple loop, which
introduces looping overhead.
Feb 28, 2023, 05:44 by li...@tompass
On 2023-02-28, Thomas Passin wrote:
> On 2/28/2023 10:05 AM, Roel Schroeven wrote:
>> Op 28/02/2023 om 14:35 schreef Thomas Passin:
>>> On 2/28/2023 4:33 AM, Roel Schroeven wrote:
[...]
(2) Searching for a string in another string, in a performant way, is
not as simple as it first
On 2023-03-01, Simon Ward wrote:
> On Tue, Feb 28, 2023 at 04:05:19PM -0500, [email protected] wrote:
>>Is it rude to name something "black" to make it hard for some of us to
>>remind them of the rules or claim that our personal style is so often
>>the opposite that it should be called "whit
On 01/03/2023 18:46, Thomas Passin wrote:
If this is what actually happened, this particular behavior occurs
because Python on Windows in a console terminates with a
instead of the usual .
I think you mean .
--
https://mail.python.org/mailman/listinfo/python-list
On 2/03/23 10:59 am, gene heskett wrote:
Human skin always has the same color
Um... no?
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On 2023-03-02, Chris Angelico wrote:
> On Thu, 2 Mar 2023 at 08:01, <[email protected]> wrote:
>> On 2023-03-01 at 14:35:35 -0500,
>> [email protected] wrote:
>> > What would have happened if all processors had been required to have
>> > some low level instruction that effecti
On 2023-03-02, Stephen Tucker wrote:
> The range function in Python 2.7 (and yes, I know that it is now
> superseded), provokes a Memory Error when asked to deiliver a very long
> list of values.
>
> I assume that this is because the function produces a list which it then
> iterates through.
>
> 1
I found Hen Hanna's "packing" problem to be an intriguing one: Given a
list of words:
['APPLE', 'PIE', 'APRICOT', 'BANANA', 'CANDY']
find a string (in general non-unique) as short as possible which
contains the letters of each of these words, in order, as a subsequence.
It struck me as being
Slightly improved version (deals with multiple characters together
instead of one at a time):
# Pack.py
def Pack(Words):
if not Words:
return ''
# The method is to build up the result by adding letters at the
beginning
# and working forward, and by adding letters at the end,
On 3/03/23 9:54 am, Ian Pilcher wrote:
I haven't found
anything that talks about which form is considered to be more Pythonic
in those situations where there's no functional difference.
In such cases I'd probably go for type(x), because it looks less
ugly.
x.__class__ *might* be slightly more
On 4/03/23 7:51 am, [email protected] wrote:
I leave you with the question of the day. Was Voldemort pythonic?
Well, he was fluent in Parseltongue, which is not a good sign.
I hope not, otherwise we'll have to rename Python to "The Language
That Shall Not Be Named" and watch out for horcr
On 5/03/23 5:12 pm, Dino wrote:
I can do a substring search in a list of 30k elements in less than 2ms
with Python. Is my reasoning sound?
I just did a similar test with your actual data and got
about the same result. If that's fast enough for you,
then you don't need to do anything fancy.
--
On 01/03/2023 00:13, Peter J. Holzer wrote:
[This isn't specifically about DIPY, I've noticed the same thing in
other announcements]
On 2023-02-28 13:48:56 -0500, Eleftherios Garyfallidis wrote:
Hello all,
We are excited to announce a new release of DIPY: DIPY 1.6.0 is out from
the oven!
On 05/03/2023 22:59, aapost wrote:
On 3/5/23 17:43, Stefan Ram wrote:
The following behaviour of Python strikes me as being a bit
"irregular". A user tries to chop of sections from a string,
but does not use "split" because the separator might become
more complicated so that a regu
On 6/03/23 1:02 pm, Cameron Simpson wrote:
Also, fsync() need not expedite the data getting to disc. It is equally
valid that it just blocks your programme _until_ the data have gone to
disc.
Or until it *thinks* the data has gone to the disk. Some drives
do buffering of their own, which may i
On 6/03/23 11:43 am, Stefan Ram wrote:
A user tries to chop of sections from a string,
but does not use "split" because the separator might become
more complicated so that a regular expression will be required
to find it.
What's wrong with re.split() in that case?
--
Greg
--
https:
On 7/03/23 4:35 am, Weatherby,Gerard wrote:
If mailing space is a consideration, we could all help by keeping our replies
short and to the point.
Indeed. A thread or two of untrimmed quoted messages is probably
more data than Dino posted!
--
Greg
--
https://mail.python.org/mailman/listinfo/p
On 7/03/23 6:49 am, [email protected] wrote:
But the example given wanted to match something like "V6" in middle of the text
and I do not see how that would work as you would now need to search 26 dictionaries
completely.
It might even make things worse, as there is likely to be a lot of
On 9/03/23 8:29 am, [email protected] wrote:
They seem to be partially copying from python a
feature that now appears everywhere but yet strive for some backwards
compatibility. They simplified the heck out of all kinds of expressions by
using INDENTATION.
It's possible this was at least pa
On 10/03/23 10:08 am, Grant Edwards wrote:
It finally dawned on me after seeing an example I found elsewhere that
you don't call some module method to fetch the next user-entered line.
You call the input() built-in.
Having a module modify the behavior of a built-in makes me cringe.
Importing
On 10/03/23 10:59 am, Cameron Simpson wrote:
I think this might be the common case of a module which wraps another
library
It's not quite the same thing, though -- the library it wraps
is already hooked into things behind the scenes in ways that
may not be obvious. (Unless you're Dutch?)
--
Gr
On 10/03/23 11:43 am, Chris Angelico wrote:
import readline
print("Pseudo-prompt: ", end="")
msg1 = input()
msg2 = input("Actual prompt: ")
print(repr(msg1))
print(repr(msg2))
At each of the prompts, type a bit of text, then backspace it all the
way. The actual prompt will remain, but the pseudo
On 10/03/23 12:43 pm, Grant Edwards wrote:
When a computer dies, I
generally just cp -a (or rsync -a) $HOME to a new one.
Same here, more or less. My current machine has multiple
archaeological layers going back about 5 generations of
technology...
--
Greg
--
https://mail.python.org/mailman/li
On 10/03/23 1:46 pm, Grant Edwards wrote:
That's not how it acts for me. I have to "import readline" to get
command line recall and editing.
Maybe this has changed? Or is platform dependent?
With Python 3.8 on MacOSX I can use up arrow with input()
to recall stuff I've typed before, without ha
On 10/03/23 2:57 pm, Chris Angelico wrote:
import sys; "readline" in sys.modules
Is it?
Yes, it is -- but only when using the repl!
If I put that in a script, I get False.
My current theory is that it gets pre-imported when using
Python interactively because the repl itself uses it.
--
Greg
On 10/03/23 4:00 pm, [email protected] wrote:
My ~/.pythonrc contains the following:
import readline
import rlcompleter
readline.parse_and_bind( 'tab: complete' )
I don't have a ~/.pythonrc, so that's not what's doing it
for me.
--
Greg
--
https://mail.python.o
On 2023-03-13, Morten W. Petersen wrote:
> I was working in Python today, and sat there scratching my head as the
> numbers for calculations didn't add up. It went into negative numbers,
> when that shouldn't have been possible.
>
> Turns out I had a very small typo, I had =- instead of -=.
>
> I
On 14/03/2023 21:28, [email protected] wrote:
TThere are people now trying to in some ways ruin the usability by putting in
type hints that are ignored and although potentially helpful as in a linter
evaluating it, instead often make it harder to read and write code if required
to use it
On 15/03/23 10:57 pm, scruel tao wrote:
How can I understand this? Will it be a problem?
I can't remember any details offhand, but I know I've occasionally
made use of the ability to do this. It's fine as long as the method
you're calling doesn't rely on anything you haven't initialised yet.
-
I accidentally used 'argparse' like this in my Python 3.9 program:
parser.add_argument ("-c, --clean", dest="clean", action="store_true")
parser.add_argument ("-n, --dryrun", dest="dryrun", action="store_true")
instead of:
parser.add_argument ("-c", "--clean", dest="clean", action="store_
Thomas Passin wrote:
Are you trying to troll here?
You just showed how you got an error with this construction, so why are you
asking how to
get an error with this construction?
I meant (obviously), another error-message besides:
error: unrecognized arguments: -cn
Perhaps from 'parser.
f
Rob Cliffe via Python-list
Date: Thursday, March 2, 2023 at 2:12 PM
To: [email protected]
Subject: Re: Packing Problem
*** Attention: This is an external email. Use caution responding, opening
attachments or clicking on links. ***
Slightly improved version (deals with multiple charac
Thomas Passin wrote:
So please, try to think out how your questions will seem to the reader, and be clear about what you are asking. You may
not know the terminology that some other people use, but don't let that stop you from being clear about what you really
need to find out. Including more
On 20/03/23 7:07 am, Jon Ribbens wrote:
Ah, apparently it got removed in Python 3, which is a bit odd as the
last I heard it was added in Python 2.2 in order to achieve consistency
with other types.
As far as I remember, the file type came into existence
with type/class unification, and "open"
On 2023-03-19, Stefan Ram wrote:
> Peng Yu writes:
>>But when I try the following code, get_body() is not found. How to get
>>get_body() to work?
>
> Did you know that this post of mine here was posted to
> Usenet with a Python script I wrote?
>
> That Python script has a function to show t
On 2023-03-19, Stefan Ram wrote:
> Jon Ribbens writes:
>>(Also, I too find it annoying to have to avoid, but calling a local
>>variable 'file' is somewhat suspect since it shadows the builtin.)
>
> Thanks for your remarks, but I'm not aware
> of such a predefined name "file"!
Ah, apparently
On 2023-03-19, Greg Ewing wrote:
> On 20/03/23 7:07 am, Jon Ribbens wrote:
>> Ah, apparently it got removed in Python 3, which is a bit odd as the
>> last I heard it was added in Python 2.2 in order to achieve consistency
>> with other types.
>
> As far as I remember, the file type came into exist
The base class:
class Constraint(object):
def __init__(self, strength):
super(Constraint, self).__init__()
self.strength = strength
def satisfy(self, mark):
global planner
self.choose_method(mark)
The subclass:
class UrnaryConstraint(Constraint):
def __init__
Thanks to Richard Damon and Peter Holzer for your replies. I'm working through
the call chain to understand better so I can post a followup question if
needed.
Thanks again.
Jen
Mar 26, 2023, 19:21 by [email protected]:
> On 3/26/23 1:43 PM, Jen Kris via Python-li
the choose_method in the UrnaryConstraint
class because of "super(BinaryConstraint, self).__init__(strength)" in step 2
above?
Thanks for helping me clarify that.
Jen
Mar 26, 2023, 18:55 by [email protected]:
> On 2023-03-26 19:43:44 +0200, Jen Kris via Python-list wrote:
&g
Cameron,
Thanks for your reply. You are correct about the class definition lines – e.g.
class EqualityConstraint(BinaryConstraint). I didn’t post all of the code
because this program is over 600 lines long. It's DeltaBlue in the Python
benchmark suite.
I’ve done some more work since thi
Thanks to everyone who answered this question. Your answers have helped a lot.
Jen
Mar 27, 2023, 14:12 by [email protected]:
> On 3/26/23 17:53, Jen Kris via Python-list wrote:
>
>> I’m asking all these question because I have worked in a procedural style
>> for many
On 28/03/23 2:25 pm, Travis Griggs wrote:
Interestingly the error also only started showing up when I switched from
running a statistics.mean() on one of these, instead of what I had been using,
a statistics.median(). Apparently the kind of iteration done in a mean, is more
conflict prone than
On 30/03/23 6:13 am, Chris Angelico wrote:
I'm not sure what would happen in
a GIL-free world but most likely the lock on the input object would
still ensure thread safety.
In a GIL-free world, I would not expect deque to hold a lock
the entire time that something was iterating over it. That
wo
On 30/03/23 8:39 am, a a wrote:
How to add clickable url links to the following 3D Matplotlib chart to make it
knowledge representation 3D chart, make of 1,000+ open Tabs in Firefox ?
It seems that matplotlib can be made to generate SVG images with
hyperlinks in them:
https://matplotlib.org/s
On 4/04/23 2:09 pm, [email protected] wrote:
Sadly, between Daylight Savings time and a newer irrational PI π Day, I am
afraid some April Foolers got thrown off albeit some may shower us with
nonsense in May I.
Pi day isn't responsible, but it is because of changes to daylight
saving. T
On 14/04/23 4:55 am, [email protected] wrote:
While we are at it, why stop with imaginary numbers when you can imagine
extensions thereof? Unfortunately, it has been proven there are and can only
be two additional such constructs.
You can go beyond that if you broaden your horizons enough.
How are you invoking your script? Presumably you have some code
in your embedding application that takes a script path and runs
it. Instead of putting the code to update sys.path into every
script, the embedding application could do it before running
the script.
--
Greg
--
https://mail.python.org
On 23/04/23 10:04 am, Ralf M. wrote:
I thought about that, but for that to work all local modules across all
script locations must have unique names, otherwise import might get hold
of a module from the wrong directory.
You could put all the local modules belonging to a particular
script into
On 4/24/23 09:14, Stefan Ram wrote:
Grant Edwards writes:
The other big advantage of an ncurses program is that since curses
support is in the std library, a curses app is simpler to distribute.
IIRC curses is not in the standard library /on Windows/. I miss
a platform independent (well
On 4/24/23 11:32, Grant Edwards wrote:
On 2023-04-24, Grant Edwards wrote:
The other big advantage of an ncurses program is that since curses
support is in the std library, a curses app is simpler to
distribute. Right now, the application is a single .py file you
just copy to the destination
This puzzled me at first, but I think others have nailed it. It is not
to do with the 'with' statement, but with the way functions are defined.
When a class is instantiated, as in x=X():
the instance object gets (at least in effect), as attributes,
copies of functions defined *in the class*
On 30/04/23 2:43 am, jak wrote:
Maybe I expressed myself badly but I didn't mean to propose alternatives
to the EAFP way but just to evaluate the possibility that it is not a
folder.
If it's not a folder, you'll find out when the next thing you
try to do to it fails.
You could check for it ear
On 4/05/23 9:29 am, Chris Angelico wrote:
So
you're asking for map to be able to return an iterator if given an
iterator, or an adapter if given an adapter. That makes it quite
complicated to use and reason about.
Also a bit slower, since it would need to inspect its argument
and decide what to
Charles,
by your own admission, you deleted your pkl file,
And your code doesn't write that pkl file (pickle.dumps(...) doesn't
write a file it creates a new string and at no point will it write to
the file :
What you need is this :
import pickle
number=2
my_pickled_
Hi,
Need some help,
in the Python, I have a array of string
var_array=["Opt1=DG","Opt1=DG2"]
I need to call c library and pass var_array as parameter
In the argtypes, how do I set up ctypes.POINTER(???) for var_array?
func.argtypes=[ctypes.c_void_p,ctypes.c_int, ctypes.POINTER()]
I
Awesome, thanks!
On Thu, May 11, 2023 at 1:47 PM Eryk Sun wrote:
> On 5/11/23, Jason Qian via Python-list wrote:
> >
> > in the Python, I have a array of string
> > var_array=["Opt1=DG","Opt1=DG2"]
> > I need to call c library and pass var_arra
Hi All
My first post (repeated)
I am having a problem with PythonPath / sys.path
I have a dir where I keep all my current work, but I can't seem to add it to
PythonPath / sys.path
When I try to import one of my modules I see
>>>import My_Working_File
Traceback (most recent call last):
File
Sunday, May 14, 2023 at 11:11, Mats Wichmann wrote:
Re: PythonPath / sys.path (at least in part)
>On 5/14/23 10:43, Barry wrote:
>> I take it you have business reasons to use an obsolete version python.
>> Where did you get your version of python from?
>In fact, a *nine* year old version of Pyt
Tuesday, May 16, 2023 at 9:26, Alan Gauld wrote:
Re: What to use instead of nntplib? (at least in part)
>On 15/05/2023 22:11, Grant Edwards wrote:
>> I got a nice warning today from the inews utility I use daily:
>>
>> DeprecationWarning: 'nntplib' is deprecated and slated for removal in
>>
Hi,
I Need some of your help.
I have the following C code to import *Import python.* It works 99% of
the time, but sometimes receives "*ImportError('Error: Reinit is
forbidden')*". error.
**We run multiple instances of the app parallelly.
*** Python version(3.7.0 (v3.7.0:1bf9cc5093, Ju
I am trying to learn tkinter.
Several examples on the internet refer to a messagebox class
(tkinter.messagebox).
But:
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> impor
On Thu, May 18, 2023 at 3:53 AM Barry wrote:
>
>
> > On 17 May 2023, at 20:35, Jason Qian via Python-list <
> [email protected]> wrote:
> >
> > Hi,
> >
> > I Need some of your help.
> >
> > I have the following C code to impor
Morning All
I'm working through the tutorial and running / saving work that I wish to keep
and build on, most times I can save and (re)import later with no difference to
when typed in console or editor and run with F5 (which saves before it can run)
But sometimes saved work (albeit small) whe
Friday, May 19, 2023 at 12:25, Barry Scott wrote:
Re: Silly (maybe) question re impor (at least in part)
>
>
>> On 19 May 2023, at 07:44, Grizzy Adams via Python-list
>> wrote:
>>
>> Morning All
>>
>> I'm working through the tutorial and runnin
On 21/05/23 5:54 am, Alex Jando wrote:
hash.=hexdigest()
That would be a very strange and unprecedented syntax that
munges together an attribute lookup and a call.
Keep in mind that a method call in Python is actually two
separate things:
y = x.m()
is equivalent to
f = x.m
y = f()
But it
On 21/05/23 9:18 am, Richard Damon wrote:
This just can't happen (as far as I can figure) for .= unless the object
is defining something weird for the inplace version of the operation,
Indeed. There are clear use cases for overriding +=, but it's hard to
think of one for this. So it would just
On 2023-05-22, Skip Montanaro wrote:
>> My understanding is that nntplib isn't being erased from reality,
>> it's merely being removed from the set of modules that are provided
>> by default.
>>
>> I presume that once it's removed from the core, it will still be
>> possible to install it via pip o
On 20/05/2023 18:54, Alex Jando wrote:
I have many times had situations where I had a variable of a certain type, all
I cared about it was one of it's methods.
For example:
import hashlib
hash = hashlib.sha256(b'word')
hash = hash.
This sort of code might be better as a single expression. For example:
user = (
request.GET["user"]
.decode("utf-8")
.strip()
.lower()
)
user = orm.user.get(name=user)
LOL. And I thought I was the one with a (self-confessed) tendency to
write too slick, dense, smart-alec
On 23/05/2023 22:03, Peter J. Holzer wrote:
On 2023-05-21 20:30:45 +0100, Rob Cliffe via Python-list wrote:
On 20/05/2023 18:54, Alex Jando wrote:
So what I'm suggesting is something like this:
hash = hashlib.sha256(b'w
I have recently started converting a large project to tkinter, starting
with zero knowledge of tkinter. (You are free to think: BAD IDEA. 😁)
I am well aware that adopting a new tool always involves a learning
curve, and that one is prone to think that things are more difficult
than they are/sho
On 25/05/23 7:49 pm, BlindAnagram wrote:
The first of these three results produces an incorrect relative path
because relpath does not strip off any non-directory tails before
comparing paths.
It has no way of knowing whether a pathname component is a directory
or not. It's purely an operation
Thanks to everyone who replied. All replies were constructive, none
were telling me to stop belly-aching.
I forgot/omitted to state that it was I who wrote the original project
(in a completely different language), making the task of re-writing it
much less formidable. And meaning that I am fa
Originally posted to idle-dev, but thought this might be a better place. Let me
know if it isn't.
Hi,
I was curious about the internals of IDLE, and noticed that IDLE uses executes
user code in a "subprocess" that's separate from the Python interpreter that is
running IDLE itself (which does t
On 31/05/23 8:44 am, aapost wrote:
Even if I did partake in the modern github style of code distribution,
how many packages have issues where the "maintainers" inherited the
package and really haven't dug deep enough in to the code to see how it
really works. They have issues that sit around fo
On 29/05/23 8:10 am, James Schaffler wrote:
However, some minimal testing of InteractiveInterpreter leads me to believe
that the Interpreter object has its own view of local/global variables and
therefore shouldn't be able to affect the calling interpreter
Globals you create by executing code
On Tuesday, May 30th, 2023 at 9:14 PM, Greg Ewing wrote:
> Globals you create by executing code in the REPL have their own
> namespace. But everything else is shared -- builtins, imported
> Python modules, imported C extension modules, etc. etc.
Thanks for the explanation. Could you elaborate on p
On Tuesday, May 30th, 2023 at 10:18 PM, Chris Angelico wrote:
> Yep, what you're seeing there is the namespace and nothing else. But
> if you mess with an actual builtin object, it'll be changed for the
> other interpreter too.
>
> > > > import ctypes
> > > > ctypes.cast(id(42), ctypes.POINTER(cty
On Wed, 7 Jun 2023 at 00:42, Roel Schroeven wrote:
> (Recently there has been an effort to provide clearer and more useful
> error messages; this seems to be a case where there is still room for
> improvement: "SyntaxError: invalid syntax" doesn't immediately remind me
> of that fact that 'return'
Op 6/06/2023 om 16:48 schreef Chris Angelico via Python-list:
On Wed, 7 Jun 2023 at 00:42, Roel Schroeven wrote:
> (Recently there has been an effort to provide clearer and more useful
> error messages; this seems to be a case where there is still room for
> improvement: "Syntax
Roel Schroeven wrote:
Op 6/06/2023 om 16:08 schreef Chris Angelico:
On Wed, 7 Jun 2023 at 00:06, Neal Becker wrote:
>
> The following f-string does not parse and gives syntax error on 3.11.3:
>
> f'thruput/{"user" if opt.return else "cell"} vs. elevation\n'
>
> However this expression, which is
1801 - 1900 of 5877 matches
Mail list logo