[Python-Dev] Language reference updated for metaclasses

Eli Bendersky eliben at gmail.com
Tue Jun 5 09:20:58 CEST 2012


On Tue, Jun 5, 2012 at 10:18 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Tue, Jun 5, 2012 at 1:24 PM, Eli Bendersky <eliben at gmail.com> wrote:
>>
>> "if an explicit metaclass is given and it is not an instance of
>> type(), then it is used directly as the metaclass"
>>
>> Could you elaborate on this point? Would it perhaps be clearer to say
>> "if an explicit metaclass is given and it is not a class"?
>
> Unfortunately, the term "a class" is slightly ambiguous. "cls is a
> class" can mean either "isinstance(cls, type)" or it can be shorthand
> for "cls is a user-defined class (i.e. not a builtin type)".
>

Yes, confusing it is
(http://eli.thegreenplace.net/2012/03/30/python-objects-types-classes-and-instances-a-glossary/)

Still, instance of type()" is a bit too cryptic for mere mortals, IMHO.

Eli


More information about the Python-Dev mailing list