Shidai Liu wrote:
Hi all,
I'll sum up a question as following:
def int5():
'''return 5'''
return 5
class my_int(int):
def __init__(self):
self.id = int5()
int.__init__(self, self.id) # FIXME: this line doesn't work
the above code act like this:
I = my_int()
I
0
I want i
On Tue, 8 Mar 2005 17:15:00 -0800 (PST), Terry Carroll <[EMAIL PROTECTED]>
wrote:
> On Tue, 8 Mar 2005, Shidai Liu wrote:
>
> > I'll sum up a question as following:
> >
> > def int5():
> > '''return 5'''
> > return 5
> >
> > class my_int(int):
> > def __init__(self):
> > self.
On Tue, 8 Mar 2005, Shidai Liu wrote:
> I'll sum up a question as following:
>
> def int5():
> '''return 5'''
> return 5
>
> class my_int(int):
> def __init__(self):
> self.id = int5()
> int.__init__(self, self.id) # FIXME: this line doesn't work
>
> the above code
Quoting Max Noel <[EMAIL PROTECTED]>:
> I'm not absolutely confident with inheritance in Python (nearly all of
> my serious OO work has been in Java), but shouldn't the call to the
> superclass's constructor be the very first statement of the subclass's
> constructor?
No ...
Or, well, ma
On Mar 8, 2005, at 22:10, Shidai Liu wrote:
Hi all,
I'll sum up a question as following:
def int5():
'''return 5'''
return 5
class my_int(int):
def __init__(self):
self.id = int5()
int.__init__(self, self.id) # FIXME: this line doesn't work
I'm not absolutely confident
Hi all,
I'll sum up a question as following:
def int5():
'''return 5'''
return 5
class my_int(int):
def __init__(self):
self.id = int5()
int.__init__(self, self.id) # FIXME: this line doesn't work
the above code act like this:
>>> I = my_int()
>>> I
0
I want it to