On 22/07/11 13:32, Karim wrote:
> 
> I think you did a typo
> 
> it is
> 
> def foo2(self, len = self._myvar):
>        while i<  len:
>      dosomething
> 

That, of course, won't work: the default argument (in this case:
"self._myvar") is looked up when the function is created, and stored
with the function. "self" does not exist at that point. (or, if it does,
it's the wrong "self")

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to