[docs] [issue12634] Random Remarks in class documentation

Ezio Melotti report at bugs.python.org
Mon Jul 25 11:24:02 CEST 2011

Ezio Melotti <ezio.melotti at gmail.com> added the comment:

Indeed that paragraph is not really clear.  I had to read it till the end ("verbs for methods and nouns for data attributes") to figure out what it was talking about.  Even then it's still not clear what it's trying to say.
I *think* it means that if you have a class Foo with a method bar, and you do Foo.bar = 'data', the method will be overridden (so you won't be able to do Foo.bar for the 'data' and Foo.bar() for the method), but the opposite is also true.
Moreover I find both the suggestions for avoiding conflicts (capitalizing method names and/or using an underscore) wrong (both against PEP8).  Also it never happened to me to have an attribute with the same name of a method, and I think in general it's not a common case (becase, as the paragraph says, methods are verbs and attributes nouns).

The whole thing could be rewritten to just say that an attribute name always refers to a single object, either to a method or to some "data".

nosy: +eric.araujo, ezio.melotti, terry.reedy
versions: +Python 3.2, Python 3.3

Python tracker <report at bugs.python.org>

More information about the docs mailing list