[Python-Dev] PEP 8 updates/clarifications (original) (raw)

Phillip J. Eby pje at telecommunity.com
Tue Dec 13 00:15:01 CET 2005


At 02:59 PM 12/12/2005 -0800, Alex Martelli wrote:

On 12/12/05, Phillip J. Eby <pje at telecommunity.com> wrote: > At 02:25 PM 12/12/2005 -0600, Ian Bicking wrote: > >That looks good to me. Well, I actually try not to use cls as the first > >argument to metaclass's new method, because there's so many classes > >being tossed about at that point that I try to be more explicit. But I > >don't consider that a common enough issue to be worth mentioning in PEP 8. > > I usually use 'meta' as the first argument of a metaclass new or a > metaclass classmethod, to avoid this particular bit of confusion.

...while I use 'mcl' for the same purpose (seems closer to me in spirit to 'cls' than 'meta' would be); Guido said he liked that, at the time (a couple of years ago) when he was following a talk of mine on metaclasses where I introduced this convention.

I'd rather see 'metaclass' fully spelled out than resort to 'mcl'; metaclass code is tricky enough to write without figuring out abbreviations. :)

Indeed, the only reason I use 'cls' is because it was Pronounced the standard; before the pronouncement I was using 'klass' as the argument name for class methods.



More information about the Python-Dev mailing list