Can somebody tell me why my IDLE hangs when asked setrecursionlimit.
>>> x=GetSet(40)
>>> x.var
40
>>> x.__dict__
{'var': 40}
>>> del x.var
>>> x.__dict__
{}
>>> import sys
>>> sys.setrecursionlimit(7)
regards,
Sarma.
___
Tutor maillist -
monik...@netzero.net wrote:
>
> Hi:
> Below is code where mistakenly self.var is named the same as function var
> instead of a different name. I know that this is not correct but I was
> experimenting to see what happens.
> class GetSet():
GetSet is a classic class -- when you use properties
Hi:
Below is code where mistakenly self.var is named the same as function var
instead of a different name. I know that this is not correct but I was
experimenting to see what happens.
class GetSet():
def __init__(self, value):
#self.attrval = value
self.var = value