I was looking at the source code for Gadfly , a python-based SQL database, and I noticed in one of the files that various methods use a reserved word as:
Code excerpt from bindings.py:
def trl1as(l,c):
[name, as, alias] = l
return [(name, alias)]
....
def selectname(list, context):
[exp, as, alias] = list
return (exp, alias)
As expected, when I tried to import this file into the python shell, it gave me a syntax error.
>>> from gadfly import bindings
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "gadfly/bindings.py", line 64
[create, view, name, namelist, as, selection] = l
^
SyntaxError: invalid syntax
How do you avoid using reserved words?
source
share