[Python-projects] Metaclass method should have "mcs" as first argument?

Maarten ter Huurne maarten.ter.huurne at philips.com
Tue Jul 3 19:10:39 CEST 2007



Hi,

When running PyLint on a metaclass I wrote, I get the following warning:

C0203:123:_SomeMeta.__iter__: Metaclass method should have "mcs" as first
argument

I wonder what the rationale behind this naming convention is. The first
argument to a normal metaclass method is the class it operates on.
Therefore, I had named the first argument "cls", just like the first
argument of classmethods on ordinary classes. Naming it "mcs" would lead me
to think that the metaclass itself is passed as the first argument, but
that is not the case.

Can someone please explain this convention to me?

Bye,
            Maarten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.logilab.org/pipermail/python-projects/attachments/20070703/877a63e8/attachment.htm 


More information about the Python-Projects mailing list