Style guide for subclassing built-in types?

janeaustine50 at hotmail.com janeaustine50 at hotmail.com
Wed Feb 23 04:36:57 EST 2005


Fuzzyman wrote:
> I guess print is using the __repr__ (or __str__ ?) methods of lsit -
> which you will need to override as well.
>
> Regards,
>
> Fuzzy
> http://www.voidspace.org.uk/python/index.shtml

Thank you but the problem is that I have to express my intention in
duplicate places -- __iter__(along with "next"), __str__, __eq__ and so
on.

p.s. the reason I'm not sticking to reversed or even reverse : suppose
the size of the list is huge.




More information about the Python-list mailing list