On Tue, Jun 10, 2008 at 8:10 PM, Maciej Fijalkowski <fijall at gmail.com> wrote: > What do you think about this code: > > class A: > locals()[42] = 98 > > Seems people rely on it working. Do we consider it part of python > language? (Note that you cannot do the same with getattr/setattr which > checks if argument is a string) Seems like a bug to me, but I don't think there is much we can do about it short of making locals a custom dict which rejects none string keys. -- Cheers, Benjamin Peterson "There's no place like 127.0.0.1."
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4