Re: constructor overwrite

2010-02-15 Thread Bruno Desthuilliers
Mug a écrit : hi ,i had a problem on constructor overwrite: i have something like: class obj: def __init__(self, x=100, y=None): if y is None: self.x=x else: self.y=y With such an initializer, you'll have instances with an attribute 'y' and no att

Re: constructor overwrite

2010-02-15 Thread Steve Holden
Mug wrote: > hi ,i had a problem on constructor overwrite: > i have something like: > > class obj: > def __init__(self, x=100, y=None): > if y is None: > self.x=x > else: > self.y=y > so i can call : > objet = obj() # x=100 y=None >

Re: constructor overwrite

2010-02-15 Thread Arnaud Delobelle
Mug writes: > hi ,i had a problem on constructor overwrite: > i have something like: > > class obj: > def __init__(self, x=100, y=None): > if y is None: > self.x=x > else: > self.y=y > so i can call : > objet = obj() # x=100 y=None

constructor overwrite

2010-02-15 Thread Mug
hi ,i had a problem on constructor overwrite: i have something like: class obj: def __init__(self, x=100, y=None): if y is None: self.x=x else: self.y=y so i can call : objet = obj() # x=100 y=None or objet = obj(40) # x= 40 y=None but if i do : objet = obj('not