Re: Is there a more efficient threading lock?

2023-02-26 Thread Chris Angelico
On Mon, 27 Feb 2023 at 17:28, Michael Speer wrote: > > https://github.com/python/cpython/commit/4958f5d69dd2bf86866c43491caf72f774ddec97 > > it's a quirk of implementation. the scheduler currently only checks if it > needs to release the gil after the POP_JUMP_IF_FALSE, POP_JUMP_IF_TRUE, >

Re: Is there a more efficient threading lock?

2023-02-26 Thread Michael Speer
https://stackoverflow.com/questions/69993959/python-threads-difference-for-3-10-and-others https://github.com/python/cpython/commit/4958f5d69dd2bf86866c43491caf72f774ddec97 it's a quirk of implementation. the scheduler currently only checks if it needs to release the gil after the

RE: Python 3.10 Fizzbuzz

2023-02-26 Thread avi.e.gross
Only sometimes. Is it an insult to suggest the question about what quotes to use is quite basic? Python has a wide variety of ways to make a string and if you have text that contains one kind of quote, you can nest it in the other kind. Otherwise, it really does not matter. And, yes, there

Re: Is there a more efficient threading lock?

2023-02-26 Thread Michael Speer
I wanted to provide an example that your claimed atomicity is simply wrong, but I found there is something different in the 3.10+ cpython implementations. I've tested the code at the bottom of this message using a few docker python images, and it appears there is a difference starting in 3.10.0

RE: one Liner: Lisprint(x) --> (a, b, c) instead of ['a', 'b', 'c']

2023-02-26 Thread avi.e.gross
I so rarely need to save a list in python in a form acceptable to LISP but here is a go with no visible recursion needed. >>> nested = [1, 2, [3, 4, [5, 6, 7], 8], 9] >>> print(nested) [1, 2, [3, 4, [5, 6, 7], 8], 9] # Just converting to a tuple does not change nested lists >>>

Re: TypeError: can only concatenate str (not "int") to str

2023-02-26 Thread Thomas Passin
On 2/26/2023 8:40 PM, MRAB wrote: On 2023-02-26 16:56, Hen Hanna wrote: On Sunday, February 26, 2023 at 6:41:01 AM UTC-8, Thomas Passin wrote: On 2/25/2023 8:12 PM, Hen Hanna wrote: > 2. the rude guy ('dn') hasn't offered a single word of comment that's directly relevant to it. > >

Re: TypeError: can only concatenate str (not "int") to str

2023-02-26 Thread Larry Martell
On Sun, Feb 26, 2023 at 5:46 PM Chris Angelico wrote: > On Mon, 27 Feb 2023 at 12:44, MRAB wrote: > > Oh dear. An example of Godwin's Law. > > Yeah, is that finally enough to get this user banned ? I hope so > -- https://mail.python.org/mailman/listinfo/python-list

Re: TypeError: can only concatenate str (not "int") to str

2023-02-26 Thread Chris Angelico
On Mon, 27 Feb 2023 at 12:44, MRAB wrote: > Oh dear. An example of Godwin's Law. Yeah, is that finally enough to get this user banned already? ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: TypeError: can only concatenate str (not "int") to str

2023-02-26 Thread MRAB
On 2023-02-26 16:56, Hen Hanna wrote: On Sunday, February 26, 2023 at 6:41:01 AM UTC-8, Thomas Passin wrote: On 2/25/2023 8:12 PM, Hen Hanna wrote: > 2. the rude guy ('dn') hasn't offered a single word of comment that's directly relevant to it. > > but he did offer related stuff

Re: Is there a more efficient threading lock?

2023-02-26 Thread Chris Angelico
On Mon, 27 Feb 2023 at 10:42, Jon Ribbens via Python-list wrote: > > 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

[Python-announce] ANN: Austin -- CPython frame stack sampler v3.5 is now available

2023-02-26 Thread Gabriele Tornetta
I am delighted to announce the 3.5 release of Austin. If you haven't heard of Austin before, it is an open-source frame stack sampler for CPython, distributed under the GPLv3 license. It can be used to obtain statistical profiling data out of a running Python application without a single line

Re: Python 3.10 Fizzbuzz

2023-02-26 Thread Skip Montanaro
Dang auto-correct... Should read ... double quotes around "strings" and single quotes around 'c'haracters ... On Sun, Feb 26, 2023, 6:28 PM Skip Montanaro wrote: > is there any reason to prefer"over' ? >> > > Not really. As an old C programmer for many years I used double >

Re: Python 3.10 Fizzbuzz

2023-02-26 Thread Skip Montanaro
> > is there any reason to prefer"over' ? > Not really. As an old C programmer for many years I used double quotes"around "strings" and single word around 'c'haracters, because that's what I was used to. (This was long before triple quoted strings appeared in the language.) Aside:

Re: Is there a more efficient threading lock?

2023-02-26 Thread Skip Montanaro
> And yet, it appears that *something* changed between Python 2 and Python 3 such that it *is* atomic: I haven't looked, but something to check in the source is opcode prediction. It's possible that after the BINARY_OP executes, opcode prediction jumps straight to the STORE_FAST opcode, avoiding

Re: Rob Cliffe should stop sending me rude email messages.

2023-02-26 Thread Larry Martell
On Sun, Feb 26, 2023 at 3:49 PM Hen Hanna wrote: > > Rob Cliffe should stop sending me rude email messages. You should stop spamming this lists with with meaningless posts. -- https://mail.python.org/mailman/listinfo/python-list

Re: Rob Cliffe should stop sending me rude email messages.

2023-02-26 Thread Hen Hanna
[I replied to the list, but for some reason my posts don't always get through, so I'm replying to you separately.] i guess if you have anything useful to say you can do that again. Your comments about (not "int") (whch didn't get through,

Re: Vim (To move text-Lines between files) ___ :ab wt w! ~/temp.vi ___ :ab rt r ~/temp.vi

2023-02-26 Thread Hen Hanna
On Sunday, February 26, 2023 at 10:28:41 AM UTC-8, rbowman wrote: > On Sun, 26 Feb 2023 09:17:46 -0800 (PST), Hen Hanna wrote: > > > > To move text-Lines between files --- i do this (below) Maybe > > there's a better (or more standard) way, but i've been doing this for > > 30+ years, so

Rob Cliffe should stop sending me rude email messages.

2023-02-26 Thread Hen Hanna
Rob Cliffe should stop sending me rude email messages. At the very least, Rob Cliffe should stop sending me ANY email messages, if he doesn't intend to an email i've sent him. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.10 Fizzbuzz

2023-02-26 Thread Hen Hanna
On Monday, August 29, 2022 at 7:18:22 PM UTC-7, Paul Rubin wrote: > Just because. > > from math import gcd > def fizz(n: int) -> str: >match gcd(n, 15): > case 3: return "Fizz" > case 5: return "Buzz" > case 15: return "FizzBuzz" >

Re: TypeError: can only concatenate str (not "int") to str

2023-02-26 Thread Hen Hanna
On Sunday, February 26, 2023 at 6:41:01 AM UTC-8, Thomas Passin wrote: > On 2/25/2023 8:12 PM, Hen Hanna wrote: > > 2. the rude guy ('dn') hasn't offered a single word of comment that's > > directly relevant to it. > > > but he did offer related stuff which he thinks i should be >

Re-indenting Python code in Vim

2023-02-26 Thread Hen Hanna
Re-indenting Lisp code is =% and it works really well ! (define (foo x) (dotimes (i 100) (bar bar x))) --- it doesn't work as well for Python code. (doing 5==

Re: Vim (To move text-Lines between files) ___ :ab wt w! ~/temp.vi ___ :ab rt r ~/temp.vi

2023-02-26 Thread rbowman
On Sun, 26 Feb 2023 09:17:46 -0800 (PST), Hen Hanna wrote: > To move text-Lines between files --- i do this (below) Maybe > there's a better (or more standard) way, but i've been doing this for > 30+ years, so i'll prob. keep doing it. > You can use the buffers. "a yy will add the

Re: Is there a more efficient threading lock?

2023-02-26 Thread Jon Ribbens via Python-list
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 user code actually relies on it.

Vim (To move text-Lines between files) ___ :ab wt w! ~/temp.vi ___ :ab rt r ~/temp.vi

2023-02-26 Thread Hen Hanna
within Vim, do :smile ___ To move text-Lines between files --- i do this (below) Maybe there's a better (or more standard) way, but i've been doing this for 30+ years, so i'll prob. keep doing it. i have these in my .vimrc file.

Re: one Liner: Lisprint(x) --> (a, b, c) instead of ['a', 'b', 'c']

2023-02-26 Thread Hen Hanna
On Saturday, February 25, 2023 at 11:45:12 PM UTC-8, Hen Hanna wrote: > def Lisprint(x): print( ' (' + ', '.join(x) + ')' , '\n') > > a= ' a b c ? def f x if zero? x 0 1 ' > a += ' A B C ! just an example ' > x= a.split() > > print(x) > Lisprint(x) > > ['a', 'b', 'c', '?', 'def', 'f',

Re: Is there a more efficient threading lock?

2023-02-26 Thread Jon Ribbens via Python-list
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 >:... >:>>> >:>>> dis.dis(x) >  1   0

one Liner: Lisprint(x) --> (a, b, c) instead of ['a', 'b', 'c']

2023-02-26 Thread Hen Hanna
def Lisprint(x): print( ' (' + ', '.join(x) + ')' , '\n') a=' a b c ? def f x if zero? x 0 1 ' a += ' A B C ! just an example ' x= a.split() print(x) Lisprint(x) ['a', 'b', 'c', '?', 'def', 'f', 'x', 'if', 'zero?', 'x', '0', '1', 'A', 'B', 'C', '!', 'just', 'an', 'example'] (a, b,

Re: it seems like a few weeks ago... but actually it was more like 30 years ago that i was programming in C, and

2023-02-26 Thread Hen Hanna
On Wednesday, February 22, 2023 at 10:38:00 PM UTC-8, Greg Ewing wrote: > On 23/02/23 9:37 am, Hen Hanna wrote: > > for the first several weeks... whenever i used Python... all i could think > > ofwas this is really Lisp (inside) with a thin veil of > > Java/Pascal syntax..

Re: 'dn' saying "Welcome (to the list)"

2023-02-26 Thread Hen Hanna
On Saturday, February 25, 2023 at 9:52:35 PM UTC-8, Chris Angelico wrote: > On Sun, 26 Feb 2023 at 16:23, Hen Hanna wrote: > > > > > > On Thursday, March 4, 2021 dn wrote: > > > Hi, and welcome to the list. > > > > > > note that this is the very same rude guy ('dn') who is apparently the

RE: TypeError: can only concatenate str (not "int") to str

2023-02-26 Thread avi.e.gross
Alan, Good tack. By not welcoming someone who is paranoid about being welcomed you are clearly the right kind of welcoming! Kidding aside, you have a point about one of the barrage of messages probably not getting a great answer on your tutor forum. It is the MANY messages often about fairly

Re: TypeError: can only concatenate str (not "int") to str

2023-02-26 Thread Thomas Passin
On 2/25/2023 8:12 PM, Hen Hanna wrote: 2. the rude guy ('dn') hasn't offered a single word of comment that's directly relevant to it. > but he did offer related stuff which he thinks i should be [grateful] for Please let's stop the ad hominem messages. If

Re: Is there a more efficient threading lock?

2023-02-26 Thread Barry Scott
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 :... :>>> :>>> dis.dis(x)  1   0 RESUME   0  2   2

[Python-announce] Cython 3.0 beta 1 is released

2023-02-26 Thread Stefan Behnel
Hi all, Cython 3.0 has left the alpha status – the first beta release is available from PyPI. https://cython.org/ https://pypi.org/project/Cython/ The changes in this release are huge – and the full list of improvements compared to the 0.29.x release series is entirely incredible. Cython

Re: TypeError: can only concatenate str (not "int") to str

2023-02-26 Thread Alan Gauld
On 26/02/2023 00:54, Greg Ewing via Python-list wrote: > On 26/02/23 10:53 am, Paul Rubin wrote: >> I'm not on either list but the purpose of the tutor list is to shunt >> beginner questions away from the main list. I'm not sure that's why we set it up but it is certainly a large part of our

Re: No module named _socket, on windows

2023-02-26 Thread 2QdxY4RzWzUUiLuE
On 2023-02-25 at 15:58:35 -0800, ofek shulberg wrote: > On Monday, January 4, 2010 at 9:19:21 PM UTC+2, Gabriel Genellina wrote: > > En Mon, 04 Jan 2010 14:24:22 -0300, louisJ escribi�: > > > I installed python 2.6 (from python.org) for windows XP, and then > > > Pylab. > > > When I type