Question about locals()

Gökhan SEVER gokhansever at
Tue May 19 00:35:04 EDT 2009


Could you please explain why locals() allow me to create variables that are
not legal in Python syntax. Example: locals()['1abc'] = 55. Calling of 1abc
results with a syntax error. Shouldn't it be better to raise an error during
the variable creation time?

Thank you

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list