On Sat, Nov 7, 2009 at 12:25 PM, C.T. Matsumoto <tmatsum...@gmx.net> wrote:
> Thanks Hugo,
>
> Do methods like __add__, __del__, count as built-in types? I'm aware of the
> rule you explained and use it and that's why when  I saw:
>

Built-in types are only those classes 'built in' to the python
interpreter. They include int, float, str, list, dict, tuple, and
others. Every class you define yourself (and also most classes in the
standard library) should have a Capitalized class name, no matter what
kind of methods you define for it.

> class indexer():
>    def ___getitem__(self, index):
>        return index ** 2
>
> I thought I was missing some special style, or rule. The class above is take
> from Learning Python, and there are several other examples too.
>

following the PEP 8 guidelines, that class should have been named Indexer.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to