Re: [Tutor] Classes that do operator overloading
by Hugo Arts other posts by this author
Nov 7 2009 3:18AM messages near this date
Re: [Tutor] Classes that do operator overloading
|
Re: [Tutor] Classes that do operator overloading
On Sat, Nov 7, 2009 at 10:39 AM, C.T. Matsumoto <tmatsumoto@[...].net> wrote:
> yes,
>
> class Foo: # the book says this is a class header
> Â pass
>
> As for my question it looks like the convention is if a class only has
> operator overloading then the class receives a lowercase class name.
> If the class has a mix, operator overloading and a normal method then
> the class name gets starts with a capital.
>
> It's just a detail, but I wanted to know.
>
class names should always be capitalized, no matter what kind of
methods they have.
The exceptions to this are the built-in types (int, str, list, dict,
etc.). But if you're writing a class yourself,
capitalize it.
quoting PEP 8:
Almost without exception, class names use the CapWords convention.
Classes for internal use have a leading underscore in addition.
if you want to know something, anything at all about style
conventions, read PEP 8. It's the definitive python styleguide.
http://www.python.org/dev/peps/pep-0008/
Hugo
_______________________________________________
Tutor maillist - Tutor@[...].org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Thread:
C.T. Matsumoto
Alan Gauld
Alan Gauld
Alan Gauld
Spir
C.T. Matsumoto
Hugo Arts
C.T. Matsumoto
Hugo Arts
Tim Golden
|