Getting E999 SyntaxError on valid dict comprehension
Bug #1649693 reported by
Maxime Simard
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pyflakes |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi,
I keep getting that error in my code.
my_tool.py:1444:48: E999 SyntaxError: invalid syntax
all_osd = {x: tmp_all_osd[x] for x in requested_list}
Can't figure out what is wrong here.
Python execute the line just fine and the result is as expected.
Using Python 2.7
pyflakes 1.3.0
flake8 3.2.1 (pyflakes: 1.3.0, flake8-
Any insight?
Thanks a lot,
Max
description: | updated |
affects: | pyflakes → flake8 |
no longer affects: | flake8 |
To post a comment you must log in.
Hi Max, a few things:
1. The correct issue tracker is https:/ /gitlab. com/pycqa/ flake8
2. Dictionary comprehensions were added in Python 2.7
3. To use the features of a specific version of Python, Flake8 needs to be installed using that version. In your bug report, it says you've installed on Python 2.6.6 so in fact the dictionary comprehension *is* invalid Syntax.
4. How in the world did you install Flake8 on Python 2.6? That shouldn't work. It uses features of Python 2.7 that aren't present in 2.6.