Re: Passing data attributes as method parameters

2006-04-24 Thread Piet van Oostrum
> "Panos Laganakos" <[EMAIL PROTECTED]> (PL) wrote: >PL> Thanks Ben. >PL> What does it mean that they're statically bound? It means that the default values are evaluated at definition time. At that time there isn't a variable 'self' defined. It would only work if the defaults would be evaluat

Re: Passing data attributes as method parameters

2006-04-23 Thread Jay Parlar
On Apr 23, 2006, at 4:59 PM, Panos Laganakos wrote: > Thanks Ben. > > What does it mean that they're statically bound? > > It seems weird that I'm not able to access variables in the class > namespace even though these attributes come into existance after class > instantiation. > The parameters

Re: Passing data attributes as method parameters

2006-04-23 Thread Panos Laganakos
Thanks Ben. What does it mean that they're statically bound? It seems weird that I'm not able to access variables in the class namespace even though these attributes come into existance after class instantiation. -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing data attributes as method parameters

2006-04-23 Thread Ben Cartwright
Panos Laganakos wrote: > I'd like to know how its possible to pass a data attribute as a method > parameter. > > Something in the form of: > > class MyClass: > def __init__(self): > self.a = 10 > self.b = '20' > > def my_method(self, param1=self.a, param2=self.b): >

Passing data attributes as method parameters

2006-04-23 Thread Panos Laganakos
Hello, I'd like to know how its possible to pass a data attribute as a method parameter. Something in the form of: class MyClass: def __init__(self): self.a = 10 self.b = '20' def my_method(self, param1=self.a, param2=self.b): pass Seems to produce a NameError o