Am 09.11.2012 12:37, schrieb Steven D'Aprano:
In Python 3.3:
py> class X(int):
... def __init__(self, *args):
... super().__init__(*args) # does nothing, call it anyway
...
py> x = X(22)
Traceback (most recent call last):
File "", line 1, in
File "", line 3, in __init__
TypeE
On Fri, Nov 9, 2012 at 4:37 AM, Steven D'Aprano
wrote:
> In Python 3.3:
>
> py> class X(int):
> ... def __init__(self, *args):
> ... super().__init__(*args) # does nothing, call it anyway
> ...
> py> x = X(22)
> Traceback (most recent call last):
> File "", line 1, in
> File "",
Am 09.11.2012 12:37, schrieb Steven D'Aprano:
On Fri, 09 Nov 2012 08:56:22 +0100, Ulrich Eckhardt wrote:
Or, do you suggest I don't call super().__init__()? That would seem
unclean to me.
On the contrary: calling super().__init__ when the superclass does
something you don't want (i.e. raises a
On Fri, 09 Nov 2012 08:56:22 +0100, Ulrich Eckhardt wrote:
> Am 08.11.2012 21:29, schrieb Terry Reedy:
>> On Thu, Nov 8, 2012 at 8:55 AM, Ulrich Eckhardt
>> wrote:
On 3.3, it gives me a "TypeError: object.__init__() takes no
parameters". To some extent, this makes sense to me, because t
Am 08.11.2012 21:29, schrieb Terry Reedy:
On Thu, Nov 8, 2012 at 8:55 AM, Ulrich Eckhardt
wrote:
On 3.3, it gives me a "TypeError: object.__init__() takes no
parameters". To some extent, this makes sense to me, because the
int subobject is not initialized in __init__ but in __new__. As a
workar
On 11/8/2012 12:13 PM, Ian Kelly wrote:
On Thu, Nov 8, 2012 at 8:55 AM, Ulrich Eckhardt
wrote:
Preparing for an upgrade from 2.7 to 3, I stumbled across an incompatibility
between 2.7 and 3.2 on one hand and 3.3 on the other:
class X(int):
def __init__(self, value):
super(X, se
On Thu, Nov 8, 2012 at 8:55 AM, Ulrich Eckhardt
wrote:
> Hi!
>
> Preparing for an upgrade from 2.7 to 3, I stumbled across an incompatibility
> between 2.7 and 3.2 on one hand and 3.3 on the other:
>
> class X(int):
> def __init__(self, value):
> super(X, self).__init__(value)
> X(42)
Hi!
Preparing for an upgrade from 2.7 to 3, I stumbled across an
incompatibility between 2.7 and 3.2 on one hand and 3.3 on the other:
class X(int):
def __init__(self, value):
super(X, self).__init__(value)
X(42)
On 2.7 and 3.2, the above code works. On 3.3, it gives me a "TypeErr