On Wed, Nov 26, 2014 at 8:30 AM, Ian Cordasco
<graffatcolmin...@gmail.com> wrote:
>
> The trick here would be ensuring this only applies to Python 2. Take
> for example the following on Python 3:
>
>     [x for x in range(3)]
>     print(x)
>
> You will get a NameError because x is undefined outside the list
> comprehension.

Note that pylint just grew a --py3k flag, which is used when scanning
Python 2.x code looking for potential problems porting to Python 3.x.
If pyflakes grew a similar flag, William's proposed check could be
enabled only when --py3k was given.

Skip
_______________________________________________
code-quality mailing list
code-quality@python.org
https://mail.python.org/mailman/listinfo/code-quality

Reply via email to