Nick Coghlan wrote:
Any volunteers out there willing to put some words about __new__
together for the main Python docs, please consider posting them on SF :)
Done.
http://sourceforge.net/tracker/?func=detailaid=1156412group_id=5470atid=105470
STeVe
--
gry@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,
I'm hoping someone can point out where I'm going wrong here. Here's a
snippet of a Python interactive session (2.3, if it makes a difference):
--
class X(list):
... def __init__(self, n):
... v = range(n)
... list.__init__(self, v)
...
x = X(10)
Dave Opstad wrote:
I'm hoping someone can point out where I'm going wrong here. Here's a
snippet of a Python interactive session (2.3, if it makes a difference):
--
class X(list):
... def __init__(self, n):
... v = range(n)
... list.__init__(self, v)
In article [EMAIL PROTECTED],
Dave Opstad [EMAIL PROTECTED] wrote:
I'm hoping someone can point out where I'm going wrong here. Here's a
snippet of a Python interactive session (2.3, if it makes a difference):
--
class X(list):
... def
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__
--
http://mail.python.org/mailman/listinfo/python-list