[Python-ideas] Re: concurrent.futures cancel pending at Executor.shutdown

2020-02-02 Thread Miguel Ángel Prosper
Thank you so much for the work, I was very confused on how to even start implementing it in the ProcessPoolExecutor, but you finished everything super quick! I'm suppose that this might be better in another thread but... Could it be possible to changing the context manager of the executor to

[Python-ideas] Re: addition of "nameof" operator

2020-02-02 Thread Bruce Leban
People keep mentioning refactoring. It's a red herring. No refactoring tool needs a nameof operator added to the language in order to do its job. And certainly an operator that requires running the program in order to use it is not going to be helpful. Refactoring tools analyze the program; they

[Python-ideas] Re: Annotated string literals

2020-02-02 Thread Eric V. Smith
On 2/2/2020 8:28 PM, Soni L. wrote: It'd be cool to attach metadata to string literals that doesn't end up in the resulting string object. This metadata could be used by all sorts of tools, everything from localization to refactoring. In C, some localization libraries use macros for it, such

[Python-ideas] Re: !$? operators for gratuitous overloading

2020-02-02 Thread Karl Ramm
Andrew Barnert writes: >> On Feb 2, 2020, at 07:18, Karl Ramm wrote: >> >> >> I propose adding ! and $ as (normally unimplemented) binary operators and ? >> as a unary operator so as to explicitly to give people the rope they want >> but clearly tagged "here there be shenanigans". > > Why

[Python-ideas] Re: addition of "nameof" operator

2020-02-02 Thread Andrew Barnert via Python-ideas
> On Feb 2, 2020, at 09:14, Johan Vergeer wrote: > > Thank you so much for this concrete proposal. I could not have described it > clearer myself. > > I'm not sure about leaving out the parentheses. But this is mostly out of > preference. Especially since Python also has a `type()`

[Python-ideas] Re: !$? operators for gratuitous overloading

2020-02-02 Thread Andrew Barnert via Python-ideas
> On Feb 2, 2020, at 07:18, Karl Ramm wrote: > > > I propose adding ! and $ as (normally unimplemented) binary operators and ? > as a unary operator so as to explicitly to give people the rope they want > but clearly tagged "here there be shenanigans". Why should ? be a prefix operator and the

[Python-ideas] Annotated string literals

2020-02-02 Thread Soni L.
It'd be cool to attach metadata to string literals that doesn't end up in the resulting string object. This metadata could be used by all sorts of tools, everything from localization to refactoring. In C, some localization libraries use macros for it, such as: #define LOCALIZE(s) s and it

[Python-ideas] Re: concurrent.futures cancel pending at Executor.shutdown

2020-02-02 Thread Guido van Rossum
Thank you so much for all your efforts on this change, Kyle! And thanks to Brian Q and Antoine P for reviewing. On Sun, Feb 2, 2020 at 15:40 Kyle Stanley wrote: > > I would certainly be willing to look into it. > > As an update to this thread for anyone interested in this feature, it's > been

[Python-ideas] Re: concurrent.futures cancel pending at Executor.shutdown

2020-02-02 Thread Kyle Stanley
> I would certainly be willing to look into it. As an update to this thread for anyone interested in this feature, it's been implemented in Python 3.9 for both ProcessPoolExecutor and ThreadPoolExecutor as a new parameter to Executor.shutdown(), *cancel_futures*. For a description of the

[Python-ideas] Re: addition of "nameof" operator

2020-02-02 Thread Guido van Rossum
That's based on my observation of how the discussion went. I have been participating in such discussions for 30 years now and I can usually tell how it will end long before most other participants. So I actually cringe when I see discussion go on beyond the point of usefulness. This is such a

[Python-ideas] Re: addition of "nameof" operator

2020-02-02 Thread Soni L.
On 2020-02-02 2:00 p.m., Johan Vergeer wrote: This would look pretty nice when it would just be used in f-strings. My proposal isn't just about f-strings though. It should also allow developers to get the name of a variable, class, method or function anywhere else. where do you want to do

[Python-ideas] Re: addition of "nameof" operator

2020-02-02 Thread Johan Vergeer
Thank you so much for this concrete proposal. I could not have described it clearer myself. I'm not sure about leaving out the parentheses. But this is mostly out of preference. Especially since Python also has a `type()` function. I also thought about using `name()` instead of `nameof()` to

[Python-ideas] Re: addition of "nameof" operator

2020-02-02 Thread Johan Vergeer
This would look pretty nice when it would just be used in f-strings. My proposal isn't just about f-strings though. It should also allow developers to get the name of a variable, class, method or function anywhere else. ___ Python-ideas mailing list

[Python-ideas] Re: !$? operators for gratuitous overloading

2020-02-02 Thread MRAB
On 2020-02-02 15:00, Karl Ramm wrote: We have all shared in the observation that all but the most carefully considered operator overloading tends to reduce code readability. There also many programmers that feel that they need it to make there code terse (or perhaps shiny) enough. I propose

[Python-ideas] Re: addition of "nameof" operator

2020-02-02 Thread Soni L.
On 2020-02-02 12:08 p.m., Jeff Allen wrote: On 01/02/2020 02:48, Richard Damon wrote: On 1/31/20 9:28 PM, Christopher Barker wrote: I am really confused by this whole thread: My understanding is that the impetus of the request is that if you start from an expression like nameof(foo.bar)

[Python-ideas] !$? operators for gratuitous overloading

2020-02-02 Thread Karl Ramm
We have all shared in the observation that all but the most carefully considered operator overloading tends to reduce code readability. There also many programmers that feel that they need it to make there code terse (or perhaps shiny) enough. I propose adding ! and $ as (normally

[Python-ideas] Re: addition of "nameof" operator

2020-02-02 Thread Jeff Allen
On 01/02/2020 02:48, Richard Damon wrote: On 1/31/20 9:28 PM, Christopher Barker wrote: I am really confused by this whole thread: My understanding is that the impetus of the request is that if you start from an expression like nameof(foo.bar) to get to "bar" then if you refactor your code

[Python-ideas] Re: addition of "nameof" operator

2020-02-02 Thread Johan Vergeer
Hi Guido, This thread had a lot of comments so far, both people that are pro and con. To be honest, a lot of you are a smarter and more experienced than me, so I receive all of it as learning moments. What I am wondering about is your personal motivation to say the feature won't every be a