[Python-Dev] Generator objects and list comprehensions?

Nick Coghlan ncoghlan at gmail.com
Tue Jan 31 04:48:52 EST 2017


On 30 January 2017 at 19:05, Brett Cannon <brett at python.org> wrote:
> On Sun, 29 Jan 2017 at 16:39 Craig Rodrigues <rodrigc at freebsd.org> wrote:
>> I'm OK with either approach.  Leaving things the way they are in Python 3
>> is no good, IMHO.
>
> My vote is it be a SyntaxError since you're not getting what you expect from
> the syntax.

I'd agree that's a sensible place for us to end up, as any code
relying on the current behaviour is really too clever to be
maintainable.

In terms of getting there, we'll likely want:

- SyntaxWarning or DeprecationWarning in 3.7
- Py3k warning in 2.7.x
- SyntaxError in 3.8

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list