Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Antoine Pitrou
On Sat, 25 Nov 2017 17:10:12 +1000 Nick Coghlan wrote: > On 25 November 2017 at 16:18, Nathaniel Smith wrote: > > On Fri, Nov 24, 2017 at 9:39 PM, Nick Coghlan wrote: > >> On 25 November 2017 at 15:27, Nathaniel Smith

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Antoine Pitrou
On Sat, 25 Nov 2017 03:03:02 + MRAB wrote: > On 2017-11-25 02:21, Chris Jerdonek wrote: > > On Fri, Nov 24, 2017 at 5:06 PM, Nathaniel Smith wrote: > >> On Fri, Nov 24, 2017 at 4:22 PM, Guido van Rossum > >> wrote: > >>>

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Nick Coghlan
On 25 November 2017 at 16:18, Nathaniel Smith wrote: > On Fri, Nov 24, 2017 at 9:39 PM, Nick Coghlan wrote: >> On 25 November 2017 at 15:27, Nathaniel Smith wrote: >>> On Fri, Nov 24, 2017 at 9:04 PM, Nick Coghlan wrote:

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Nathaniel Smith
On Fri, Nov 24, 2017 at 9:39 PM, Nick Coghlan wrote: > On 25 November 2017 at 15:27, Nathaniel Smith wrote: >> On Fri, Nov 24, 2017 at 9:04 PM, Nick Coghlan wrote: >>> def example(): >>> comp1 = yield from [(yield x) for x in

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Nick Coghlan
On 25 November 2017 at 15:27, Nathaniel Smith wrote: > On Fri, Nov 24, 2017 at 9:04 PM, Nick Coghlan wrote: >> def example(): >> comp1 = yield from [(yield x) for x in ('1st', '2nd')] >> comp2 = yield from [(yield x) for x in ('3rd',

[Python-Dev] PEP 565: show DeprecationWarning in __main__ (round 2)

2017-11-24 Thread Nick Coghlan
This is a new version of the proposal to show DeprecationWarning in __main__. The proposal itself hasn't changed (it's still recommending a new entry in the default filter list), but there have been several updates to the PEP text based on further development work and comments in the initial

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Nathaniel Smith
On Fri, Nov 24, 2017 at 9:04 PM, Nick Coghlan wrote: > def example(): > comp1 = yield from [(yield x) for x in ('1st', '2nd')] > comp2 = yield from [(yield x) for x in ('3rd', '4th')] > return comp1, comp2 Isn't this a really confusing way of

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Nick Coghlan
On 25 November 2017 at 13:30, Guido van Rossum wrote: > > On Fri, Nov 24, 2017 at 4:22 PM, Guido van Rossum wrote: >> >> The more I hear about this topic, the more I think that `await`, `yield` and >> `yield from` should all be banned from occurring in all

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Guido van Rossum
On Fri, Nov 24, 2017 at 4:22 PM, Guido van Rossum wrote: > The more I hear about this topic, the more I think that `await`, `yield` > and `yield from` should all be banned from occurring in all comprehensions > and generator expressions. That's not much different from

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread MRAB
On 2017-11-25 02:21, Chris Jerdonek wrote: On Fri, Nov 24, 2017 at 5:06 PM, Nathaniel Smith wrote: On Fri, Nov 24, 2017 at 4:22 PM, Guido van Rossum wrote: The more I hear about this topic, the more I think that `await`, `yield` and `yield from` should all

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Nick Coghlan
On 25 November 2017 at 11:04, Ivan Levkivskyi wrote: > On 25 November 2017 at 01:22, Guido van Rossum wrote: > >> The more I hear about this topic, the more I think that `await`, `yield` >> and `yield from` should all be banned from occurring in all

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Chris Jerdonek
On Fri, Nov 24, 2017 at 5:06 PM, Nathaniel Smith wrote: > On Fri, Nov 24, 2017 at 4:22 PM, Guido van Rossum wrote: >> The more I hear about this topic, the more I think that `await`, `yield` and >> `yield from` should all be banned from occurring in all

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Ethan Furman
On 11/24/2017 04:22 PM, Guido van Rossum wrote: The more I hear about this topic, the more I think that `await`, `yield` and `yield from` should all be banned from occurring in all comprehensions and generator expressions. That's not much different from disallowing `return` or `break`. For

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Yury Selivanov
On Fri, Nov 24, 2017 at 7:22 PM, Guido van Rossum wrote: > The more I hear about this topic, the more I think that `await`, `yield` and > `yield from` should all be banned from occurring in all comprehensions and > generator expressions. That's not much different from

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Nathaniel Smith
On Fri, Nov 24, 2017 at 4:22 PM, Guido van Rossum wrote: > The more I hear about this topic, the more I think that `await`, `yield` and > `yield from` should all be banned from occurring in all comprehensions and > generator expressions. That's not much different from

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Ivan Levkivskyi
On 25 November 2017 at 01:22, Guido van Rossum wrote: > The more I hear about this topic, the more I think that `await`, `yield` > and `yield from` should all be banned from occurring in all comprehensions > and generator expressions. That's not much different from disallowing

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Guido van Rossum
The more I hear about this topic, the more I think that `await`, `yield` and `yield from` should all be banned from occurring in all comprehensions and generator expressions. That's not much different from disallowing `return` or `break`. -- --Guido van Rossum (python.org/~guido)

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Ivan Levkivskyi
OK, so my 24 hours are over :-) On 24 November 2017 at 01:50, Nick Coghlan wrote: > On 23 November 2017 at 23:04, Ivan Levkivskyi > wrote: > >> I don't see why this particular case qualifies for such a radical measure >> as an exception to syntactic

[Python-Dev] Summary of Python tracker Issues

2017-11-24 Thread Python tracker
ACTIVITY SUMMARY (2017-11-17 - 2017-11-24) Python tracker at https://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open6267 ( +6) closed 37610 (+57) total 43877 (+63) Open issues

Re: [Python-Dev] Python initialization and embedded Python

2017-11-24 Thread Victor Stinner
I proposed a PR to explicitly list functions safe to be called before Py_Initialize(): https://bugs.python.org/issue32124 https://github.com/python/cpython/pull/4540 I found more than 11 functions.. I also found variables ;-) Victor 2017-11-24 5:01 GMT+01:00 Nick Coghlan

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread Hrvoje Niksic
Guido van Rossum writes: And my mind boggles when considering a generator expression containing yield that is returned from a function. I tried this and cannot say I expected the outcome:    def f():        return ((yield i) for i in range(3))