[Python-Dev] Non-string keys in type dict
Amaury Forgeot d'Arc
amauryfa at gmail.com
Thu Mar 8 18:41:30 CET 2012
More information about the Python-Dev mailing list
Thu Mar 8 18:41:30 CET 2012
- Previous message: [Python-Dev] Non-string keys in type dict
- Next message: [Python-Dev] Non-string keys in type dict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, 2012/3/8 Ethan Furman <ethan at stoneleaf.us>: >>> A little more experimentation shows that not all is well, however: >>> >>> --> dir(Test) >>> Traceback (most recent call last): >>> File "<stdin>", line 1, in <module> >>> TypeError: unorderable types: int() < str() >> >> >> So what conclusion do you draw? > > > That other changes (that have definitely been for the better) are making the > 'feature' of non-string keys in namespace dicts less and less friendly. > Rather than letting it slowly fall into complete shambles we should go > ahead and deprecate, then remove, that functionality. Not that I disagree with the conclusion, but the obvious thing to do here is to fix dir() and return only string attributes, i.e. those you can access with getattr. Cheers, -- Amaury Forgeot d'Arc
- Previous message: [Python-Dev] Non-string keys in type dict
- Next message: [Python-Dev] Non-string keys in type dict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list