foobarlab / UpStage-Video-Hack

UpStage Streaming Hack
http://www.foobarlab.net/
GNU General Public License v2.0
5 stars 1 forks source link

Use of (reserved) keywords as variable names #2

Open foobarlab opened 11 years ago

foobarlab commented 11 years ago

Server code (Python) should be checked for variables using reserved and special keywords.

foobarlab commented 11 years ago

List of reserved keywords/identifiers from Python 2.6 docs: http://docs.python.org/2.6/reference/lexical_analysis.html#identifiers

foobarlab commented 11 years ago

The following words should also NOT be used either (although they are not strictly Python reserved words, they conflict with the names of commonly-used Python functions): `file, type, str`` ... see more here: http://pentangle.net/python/handbook/node52.html

foobarlab commented 11 years ago

Actually PyChecker reported:

upstage/pages.py:154: (str) shadows builtin
upstage/pages.py:179: (str) shadows builtin
upstage/pages.py:263: (str) shadows builtin
upstage/pages.py:1298: (type) shadows builtin
upstage/pages.py:1680: (vars) shadows builtin
upstage/pages.py:1795: (type) shadows builtin
upstage/pages.py:1812: (file) shadows builtin
upstage/stage.py:489: (type) shadows builtin
upstage/web.py:260: (type) shadows builtin
upstage/web.py:278: (file) shadows builtin
foobarlab commented 11 years ago

A workaround would be to either switch single letters to uppercase or to prefix with an underline...