[Python-ideas] Re: Comparison operator support (>= and <=) for type

2019-06-20 Thread Jeffrey Kintscher
On 6/20/19 3:03 PM, David Mertz wrote: On Wed, Jun 19, 2019, 7:35 PM Jeffrey Kintscher > wrote: It is not at all intuitive that issubclass(A, (B, C)) means "Is A a subclass of B or a subclass of C?" when it could also mean "Is A a subclass of both

[Python-ideas] Re: Comparison operator support (>= and <=) for type

2019-06-20 Thread David Mertz
On Wed, Jun 19, 2019, 7:35 PM Jeffrey Kintscher wrote: > It is not at all intuitive that > > issubclass(A, (B, C)) > > means "Is A a subclass of B or a subclass of C?" when it could also mean > "Is A a subclass of both B and C?". > I've used issubclass() maybe 20 times in more than 20 years

[Python-ideas] Re: Overloading assignment concrete proposal (Re: Re: Operator as first class citizens -- like in scala -- or yet another new operator?)

2019-06-20 Thread nate lust
There is nothing more humbling than sending nonsense out to an entire mailing list. It will teach me to stop an process my steam of consciousness critically instead of just firing off a message. You were right that I was not at all considering how python variables must of course work (both

[Python-ideas] Re: Canceling thread in python

2019-06-20 Thread Michael Foord
On Thu, 20 Jun 2019 at 16:33, Guido van Rossum wrote: > On Thu, Jun 20, 2019 at 8:21 AM Michael Foord wrote: > > It works by raising an exception in the target thread, which the thread > is free to handle (usually for cleanup and then reraise). > > Sure, those are the right semantics. How does

[Python-ideas] Re: Canceling thread in python

2019-06-20 Thread Guido van Rossum
On Thu, Jun 20, 2019 at 8:21 AM Michael Foord wrote: > It works by raising an exception in the target thread, which the thread is free to handle (usually for cleanup and then reraise). Sure, those are the right semantics. How does it stop blocking I/O though? Suppose the thread is waiting for a

[Python-ideas] Re: Canceling thread in python

2019-06-20 Thread Rhodri James
On 20/06/2019 16:10, Matúš Valo wrote: I have found out at least this link: http://www.voidspace.org.uk/ironpython/threading.shtml There is also example of aborting thread. """ The next sections provide some simple examples of threading with IronPython, and illustrates using Thread.Abort.

[Python-ideas] Re: Canceling thread in python

2019-06-20 Thread Michael Foord
On Thu, 20 Jun 2019 at 16:11, Matúš Valo wrote: > I have found out at least this link: > > http://www.voidspace.org.uk/ironpython/threading.shtml > > There is also example of aborting thread. Thanks, good reference  It also mentions the same API in Java. Michael > > Matus >

[Python-ideas] Re: Canceling thread in python

2019-06-20 Thread Michael Foord
On Thu, 20 Jun 2019 at 13:03, Robert Collins wrote: > Do you have a link to that? Googling king .net threads got me some strange > results . > Auto-correct. Killing. Thread.abort I believe. I don't think it's very hard to find. > What made it particularly sane? > A straightforward API

[Python-ideas] Re: Canceling thread in python

2019-06-20 Thread Robert Collins
Do you have a link to that? Googling king .net threads got me some strange results . What made it particularly sane? On Thu, 20 Jun 2019, 23:59 Michael Foord, wrote: > > > On Thu, 20 Jun 2019 at 06:15, Matúš Valo wrote: > >> Hi All, >> >> Currently it is not possible to "kill" thread which

[Python-ideas] Re: Canceling thread in python

2019-06-20 Thread Michael Foord
On Thu, 20 Jun 2019 at 06:15, Matúš Valo wrote: > Hi All, > > Currently it is not possible to "kill" thread which is blocked. The > rationale for this is handling situations when thread is blocked - e.g. > when thread is quering DB when lock occurred on Database. In this case, the > main thread

[Python-ideas] Re: Canceling thread in python

2019-06-20 Thread Matúš Valo
Thank you for your reply. The use case is simple just to offload SQL query to separate thread to not block main thread. The problem is handling situation when thread is blocked due I/O to Database. I am not aware about solution like timeout of query etc. but maybe I have missed something.

[Python-ideas] Lists create

2019-06-20 Thread 21ispinks
How to list create.[09] ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at

[Python-ideas] Re: Canceling thread in python

2019-06-20 Thread Andrew Barnert via Python-ideas
On Jun 19, 2019, at 22:14, Matúš Valo wrote: > > Hi All, > > Currently it is not possible to "kill" thread which is blocked. The rationale > for this is handling situations when thread is blocked - e.g. when thread is > quering DB when lock occurred on Database. > pthread library and Windows

[Python-ideas] help() with operators [was: Comparison operator support (>= and <=) for type]

2019-06-20 Thread Franklin? Lee
Python's own docs' search doesn't seem to recognize the <= symbol. Google does, but if one doesn't know that, then one won't try it. Google inconsistently decides when and which symbols are considered word chars, and I don't know whether the rules are even documented. Perhaps `help` should be the