[Python-Dev] PEP 8 updates/clarifications
Ian Bicking
ianb at colorstudy.com
Tue Dec 13 01:09:27 CET 2005
Alex Martelli wrote:
> On 12/12/05, Phillip J. Eby <pje at telecommunity.com> wrote:
> ...
>
>>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.
>
>
> The name choices klass and meta are internally consistent, and so are
> cls and mcl. I just wouldn't like a mixed, and thus
> harder-to-remember, pair of choices such as cls and meta. Perhaps
> Guido can Pronounce one way or another and set the subdiscussion to
> rest...
I personally happily use "meta", but it doesn't seem that important,
except insofar as it is reasonable (and perhaps preferred) not to use
"cls" in that case. If someone wants to use even more verbose names in
their metaclass that'd be fine by me -- it's not the kind of code I
breeze by and expect to instantly understand like I do simple methods.
I don't think it's that important to include in PEP 8, at least as long
as no one reads the prescription of "cls" to mean they shouldn't choose
a better argument name when there's a good reason. PEP 8 generally
applies when there isn't a good reason.
--
Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
More information about the Python-Dev
mailing list