[Python-Dev] Default metaclass in Python 3.0 modules (original) (raw)
Ben Finney ben+python at benfinney.id.au
Tue Jul 15 15:03:52 CEST 2008
- Previous message: [Python-Dev] Default metaclass in Python 3.0 modules
- Next message: [Python-Dev] Default metaclass in Python 3.0 modules (was: PEP: Consolidating names and classes in the `unittest` module (updated 2008-07-15))
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Nick Coghlan <ncoghlan at gmail.com> writes:
Ben Finney wrote: > What makes that happen in the case where a class declares no > superclass? Is there an invisible enforced "metaclass = type" > for every module? Where can I read about this change?
The magic is actually in 2.x, not in 3.0. In 2.x, if you don't explicit set the metaclass (or inherit explicitly from an object which sets it), then the default metaclass is 'classobj'. In 3.0, that magic goes away and the default metaclass is just 'type'.
That helps. Thanks.
-- \ “When I get real bored, I like to drive downtown and get a | `\ great parking spot, then sit in my car and count how many | o_) people ask me if I'm leaving.” —Steven Wright | Ben Finney
- Previous message: [Python-Dev] Default metaclass in Python 3.0 modules
- Next message: [Python-Dev] Default metaclass in Python 3.0 modules (was: PEP: Consolidating names and classes in the `unittest` module (updated 2008-07-15))
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]