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=detail&aid=1156412&group_id=5470&atid=105470
STeVe
--
http://mail.python.org/mailman/listinfo/pyt
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, plea
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
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 _
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)
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(