Initializing subclasses of tuple
Nick Coghlan
ncoghlan at iinet.net.au
Wed Mar 2 07:21:10 EST 2005
gry at ll.mit.edu wrote:
> To inherit from an immutable class, like string or tuple, you need to
> use the __new__ member, not __init__. See, e.g.:
>
> http://www.python.org/2.2.3/descrintro.html#__new__
Any volunteers out there willing to put some words about __new__ together for
the main Python docs, please consider posting them on SF :)
It's currently conspicuous by its absence:
http://www.python.org/dev/doc/devel/ref/customization.html
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at email.com | Brisbane, Australia
---------------------------------------------------------------
http://boredomandlaziness.skystorm.net
More information about the Python-list
mailing list