Re: [Python-ideas] Add closing and iteration to threading.Queue

2018-10-22 Thread Nathaniel Smith
On Sun, Oct 21, 2018 at 8:31 PM, Guido van Rossum wrote: > On Sun, Oct 21, 2018 at 6:08 PM Nathaniel Smith wrote: >> I'm not sure if this is an issue the way Queue is used in practice, but in >> general you have to be careful with this kind of circular flow because if >> your queue communicates b

Re: [Python-ideas] TypeHinting: From variable name to type

2018-10-22 Thread Anders Hovmöller
I'll just simply reply here that Mypy on our entire code base just silently outputs nothing. Nothing at all. I tried to look at the code to find out why and maybe implement the name checking feature discussed here and was terrified by the Byzantine complexity of the code base. I gave up. From

Re: [Python-ideas] TypeHinting: From variable name to type

2018-10-22 Thread Steven D'Aprano
On Fri, Oct 19, 2018 at 01:14:39PM +0200, Anders Hovmöller wrote: [I wrote this] > > I've seen far too many variables called (let's say) "mylist" which > > actually hold a dict or a tuple (or in one memorable case, a string!) to > > unconditionally believe the name. > > This is an even stronger

Re: [Python-ideas] [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals

2018-10-22 Thread Michael Selik
I switched this thread to the python-ideas list, since this is proposing a new feature. On Mon, Oct 22, 2018 at 12:13 PM Sean Harrington wrote: > I contend that multiprocessing.Pool is used most frequently with a single > task. I am proposing a feature that enforces this invariant, optimizes ta

Re: [Python-ideas] TypeHinting: From variable name to type

2018-10-22 Thread Dan Sommers
On 10/22/18 9:04 AM, Steven D'Aprano wrote: My IDE is Unix. (Technically, Linux.) +1 Or just google https://duckduckgo.com/?q=unix+as+an+ide Thank you for not verbing DuckDuckGo! :-) ... (I use an actual GUI editor, not Vim or Emacs) ... [ ... must ... resist ... holy war ... ] Dan _

Re: [Python-ideas] TypeHinting: From variable name to type

2018-10-22 Thread Steven D'Aprano
On Mon, Oct 22, 2018 at 02:35:40PM +0200, Anders Hovmöller wrote: > > > But the critical point here is that we should not add a language feature > > to make up for the limitations of a single IDE. If the free version of > > PyCharm is underpowered, perhaps you ought to try the paid version, or

Re: [Python-ideas] TypeHinting: From variable name to type. Yes: no change to language, just convetion

2018-10-22 Thread Anders Hovmöller
>> This is certainly not something that requires language support. It can >> easily be purely a convention, as long as different IDEs, linters, type >> checkers, etc. agree on what the convention is. Maybe at some point in the >> future, if the convention becomes adopted, there might be some

Re: [Python-ideas] TypeHinting: From variable name to type

2018-10-22 Thread Anders Hovmöller
> But the critical point here is that we should not add a language feature > to make up for the limitations of a single IDE. If the free version of > PyCharm is underpowered, perhaps you ought to try the paid version, or > another IDE, or submit a feature request to PyCharm, *before* turning t

Re: [Python-ideas] Multi Statement Lambdas

2018-10-22 Thread Serhiy Storchaka
22.10.18 02:16, Terry Reedy пише: All functions created from lambda expressions get the same pseudo-name ''.  This can make tracebacks worse.  Perhaps more importantly, proper testing may become harder. See https://bugs.python.org/issue34856. But this can work only while lambda's body is a s

Re: [Python-ideas] TypeHinting: From variable name to type. Yes: no change to language, just convetion

2018-10-22 Thread Thomas Güttler
Am 21.10.18 um 16:44 schrieb David Mertz: On Fri, Oct 19, 2018 at 3:18 AM Thomas Güttler mailto:guettl...@thomas-guettler.de>> wrote: Now my idea: Per module and/or per file type hinting from variable name. Maybe a magic docstring in the __init__.py file: variable-name-mapping:

Re: [Python-ideas] Add closing and iteration to threading.Queue

2018-10-22 Thread Vladimir Filipović
Nathaniel, thank you for the pointer to Trio. Its approach seems very robust. I'm relieved to see that a solution so fundamentally rebuilt has also settled on very similar semantics for its `.close_put()`. I think your `.clone()` idiom is very clear when the communication objects are treated as di