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

2023-02-25 Thread Chris Angelico
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 > rudest of them all. > > note that this is the very same rude guy ('dn') who wants to shunt

Re: Is there a more efficient threading lock?

2023-02-25 Thread Chris Angelico
On Sun, 26 Feb 2023 at 16:27, Dennis Lee Bieber wrote: > > On Sat, 25 Feb 2023 15:41:52 -0600, Skip Montanaro > declaimed the following: > > > >concurrent.futures.ThreadPoolExecutor() with the default number of workers ( > >os.cpu_count() * 1.5, or 12 threads on my system) to process each month,

Re: Is there a more efficient threading lock?

2023-02-25 Thread Chris Angelico
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. > > For example, with the GIL in place, a

creepy email... Subj: Just to you.

2023-02-25 Thread Hen Hanna
i received thiscreepy email... Subj: Just to you. >>>Just to you as I see little further reason to help you ... >>>You have not taken hints that bashing the language as not doing what you >>> expect is not the way to get help so I leave you to others. i'll

Re: Is there a more efficient threading lock?

2023-02-25 Thread Dennis Lee Bieber
On Sat, 25 Feb 2023 15:41:52 -0600, Skip Montanaro declaimed the following: >concurrent.futures.ThreadPoolExecutor() with the default number of workers ( >os.cpu_count() * 1.5, or 12 threads on my system) to process each month, so >12 active threads at a time. Given that the process is pretty

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

2023-02-25 Thread Hen Hanna
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 rudest of them all. note that this is the very same rude guy ('dn') who wants to shunt me away to the TUTOR list. --- i

回复: Question about logging.config.dictConfig

2023-02-25 Thread outlook_f8d50c5b9e059...@outlook.com
    从 Windows 版[1]邮件发送   发件人: [2]Ivan "Rambius" Ivanov 发送时间: 2023年2月8日 23:29 收件人: [3]python-list@python.org 主题: Re: Question about logging.config.dictConfig   On Tue, Feb 7, 2023 at 7:35 PM Peter J. Holzer wrote: >  > On 2023-02-07 17:58:26 -0500, Ivan

Re: Is there a more efficient threading lock?

2023-02-25 Thread Jon Ribbens via Python-list
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

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

2023-02-25 Thread Hen Hanna
On Saturday, February 25, 2023 at 1:54:14 PM UTC-8, Paul Rubinwrote: > Hen Hanna writes: > > is this guy (dn) always this rude??? is he even more rude on this > > Python-Tutor list ? > I'm not on either list but the purpose of the tutor list is to shunt > beginner questions away from

Re: No module named _socket, on windows

2023-02-25 Thread ofek shulberg
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 "import pylab" in a python shell it shows the error: > > > >

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

2023-02-25 Thread Hen Hanna
On Saturday, February 25, 2023 at 4:54:36 PM UTC-8, Greg Ewing 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. > There's a fundamental problem with tutor

Re: Is there a more efficient threading lock?

2023-02-25 Thread Jon Ribbens via Python-list
On 2023-02-25, Paul Rubin wrote: > Skip Montanaro writes: >> from threading import Lock > > 1) you generally want to use RLock rather than Lock Why? > 2) I have generally felt that using locks at the app level at all is an > antipattern. The main way I've stayed sane in multi-threaded Python

unpack, pack

2023-02-25 Thread Hen Hanna
when i unpack the string (or Seed)USENEARSEYNE , i getwords like Sense, Sears, , Snare, Unary, (sarsen, seesee, senary, serene, unease, uneasy, usneae, usneas) (sensyne) How would i approach the PACKING function ? e.g. ... i want to

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

2023-02-25 Thread Hen Hanna
> PS are you aware that there is a Python-Tutor list for the use of people > learning Python? is this guy (dn) always this rude???is he even more rude on this Python-Tutor list ? he must have a reputation (for being rude)... On Friday, February 24, 2023 at 7:41:44 PM UTC-8, dn

Re: Programming by contract.

2023-02-25 Thread Cameron Simpson
On 26Feb2023 02:44, Weatherby,Gerard wrote: The discussion of asserts got me thinking about Programming by Contract. Back in the 90s, I had occasion to learn Eiffel programming language. ( https://en.wikipedia.org/wiki/Eiffel_(programming_language) The concepts are intriguing, although

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

2023-02-25 Thread avi.e.gross
Greg, Yes, the forum should be open. The first requests from the person were replied to politely. At some point a pattern was emerging of lots of fairly irreverent posts by someone who is having trouble shifting programming paradigms. The suggestion was then made as a SUGGESTION by several

Programming by contract.

2023-02-25 Thread Weatherby,Gerard
The discussion of asserts got me thinking about Programming by Contract. Back in the 90s, I had occasion to learn Eiffel programming language. ( https://en.wikipedia.org/wiki/Eiffel_(programming_language) The concepts are intriguing, although Eiffel itself had barriers to widespread adoption.

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-25 Thread Weatherby,Gerard
“So the case where the assumption fails may not be easily reproducable and the more information you can get post-mortem the better” That’s true for rare corner cases or esoteric race conditions. Usually, when I see asserts it's just because I was just plain stupid. From: Python-list on behalf

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

2023-02-25 Thread Greg Ewing via Python-list
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. There's a fundamental problem with tutor lists. They rely on experienced people, the ones capable of answering the questions, to go out of

Re: Is there a more efficient threading lock?

2023-02-25 Thread Barry
Re sqlite and threads. The C API can be compiled to be thread safe from my Reading if the sqlite docs. What I have not checked is how python’s bundled sqlite is compiled. There are claims python’s sqlite is not thread safe. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a more efficient threading lock?

2023-02-25 Thread Thomas Passin
On 2/25/2023 4:41 PM, Skip Montanaro wrote: Thanks for the responses. Peter wrote: Which OS is this? MacOS Ventura 13.1, M1 MacBook Pro (eight cores). Thomas wrote: > I'm no expert on locks, but you don't usually want to keep a lock while > some long-running computation goes on.  You

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-25 Thread Peter J. Holzer
On 2023-02-25 21:58:18 +, Weatherby,Gerard wrote: > I only use asserts for things I know to be true. Yeah, that's what assers are for. Or rather for things that you *think* are true. > In other words, a failing assert means I have a hole in my program > logic. Yes, if you include your

Re: Is there a more efficient threading lock?

2023-02-25 Thread Weatherby,Gerard
“I'm no expert on locks, but you don't usually want to keep a lock while some long-running computation goes on. You want the computation to be done by a separate thread, put its results somewhere, and then notify the choreographing thread that the result is ready.” Maybe. There are so many

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-25 Thread Weatherby,Gerard
I only use asserts for things I know to be true. Nothing is harder to debug than when something you know to be true turns out to be… not True. Because I’ll check everything else instead of the cause of the bug. In other words, a failing assert means I have a hole in my program logic. For that

Re: Is there a more efficient threading lock?

2023-02-25 Thread Skip Montanaro
Thanks for the responses. Peter wrote: > Which OS is this? MacOS Ventura 13.1, M1 MacBook Pro (eight cores). Thomas wrote: > I'm no expert on locks, but you don't usually want to keep a lock while > some long-running computation goes on. You want the computation to be > done by a separate

Re: Is there a more efficient threading lock?

2023-02-25 Thread Peter J. Holzer
On 2023-02-25 09:52:15 -0600, Skip Montanaro wrote: > BLOB_LOCK = Lock() > > def get_terms(text): > with BLOB_LOCK: > phrases = TextBlob(text, np_extractor=EXTRACTOR).noun_phrases > for phrase in phrases: > yield phrase > > When I monitor the application using py-spy,

Re: Is there a more efficient threading lock?

2023-02-25 Thread Thomas Passin
On 2/25/2023 10:52 AM, Skip Montanaro wrote: I have a multi-threaded program which calls out to a non-thread-safe library (not mine) in a couple places. I guard against multiple threads executing code there using threading.Lock. The code is straightforward: from threading import Lock #

Re: Is there a more efficient threading lock?

2023-02-25 Thread Peter J. Holzer
On 2023-02-25 09:52:15 -0600, Skip Montanaro wrote: > I have a multi-threaded program which calls out to a non-thread-safe > library (not mine) in a couple places. I guard against multiple > threads executing code there using threading.Lock. The code is > straightforward: > > from threading

Is there a more efficient threading lock?

2023-02-25 Thread Skip Montanaro
I have a multi-threaded program which calls out to a non-thread-safe library (not mine) in a couple places. I guard against multiple threads executing code there using threading.Lock. The code is straightforward: from threading import Lock # Something in textblob and/or nltk doesn't play nice

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-25 Thread Peter J. Holzer
On 2023-02-25 09:10:06 -0500, Thomas Passin wrote: > On 2/25/2023 1:13 AM, Peter J. Holzer wrote: > > On 2023-02-24 18:19:52 -0500, Thomas Passin wrote: > > > Sometimes you can use a second parameter to assert if you know what kind > > > of > > > error to expect: [...] > > > With type errors,

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-25 Thread Thomas Passin
On 2/25/2023 1:13 AM, Peter J. Holzer wrote: On 2023-02-24 18:19:52 -0500, Thomas Passin wrote: On 2/24/2023 2:47 PM, dn via Python-list wrote: On 25/02/2023 08.12, Peter J. Holzer wrote: On 2023-02-24 16:12:10 +1300, dn via Python-list wrote: In some ways, providing this information seems