On Mon, Jan 11, 2010 at 7:11 PM, Barry Warsaw <barry at python.org> wrote: > As an example, the one library I've already ported used a metaclass. I don't > see any way to specify that the metaclass should be used in a portable way. > In Python 2.6 it's: > > class Foo: > __metaclass__ = Meta > > and in Python 3 it's: > > class Foo(metaclass=Meta): > > 2to3 made that pain go away. [sidebar] 1) the metaclass fixer was a PITA to implement. 2) 95% of __metaclass__ definitions searchable via google code were of the "__metaclass__ = type" variety. The 2to3 patch exists only because of the few other uses. 3) 100% of the module level assignments in public projects were the "__metaclass__ = type" variety which is why there isn't a fixer for that. Also, a fixer would have been really, really ugly (munge every class definition in this module because there is a top level assignment). -Jack
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