skip at pobox.com wrote: > Nick> Any old code could be fixed by putting "from types import > Nick> ClassType as __metaclass__" at the top of the affected modules. > > Which would be, what, 90% of all Python code written that defines classes? I generally don't allow old-style classes in any code I have control over (well, aside from exceptions). Having to type '(object)' all the time is annoying, but less annoying than trying to figure out which set of semantics a given class is using. My interpreter startup script even includes "__metaclass__ = None" in order to disable the implicit metaclass. I think it's an artifact of only seriously starting to use Python with version 2.2.2 - I don't really understand how old-style classes work, so I try to avoid using them. However, you raise a fair point, which is why I raised the suggestion of respecting a "__metaclass__" definition in the builtins, allowing application developers to perform their own new-style class smoke test prior to Py3k. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org
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