Re: [Tutor] @property for old style classes vs new style classes

2016-09-16 Thread eryk sun
On Thu, Sep 15, 2016 at 9:48 PM, monik...@netzero.net wrote: > But why var is in class __dict__? > Does @property make it a class attribute? An instance of `property` is a data descriptor, i.e. it implements the __get__, __set__, and __delete__ methods of the descriptor

[Tutor] maximum recursion error

2016-09-16 Thread monik...@netzero.net
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

Re: [Tutor] Help with Max Number and Min number script

2016-09-16 Thread Bob Gailer
On Sep 16, 2016 8:12 PM, "Sharon Wallace" wrote: > In addition to showing us your code , Please show us whatever Trace back you got when you ran the code. I would guess you are either getting an indentation error or syntax error in the vicinity of line that begins if

[Tutor] Help with Max Number and Min number script

2016-09-16 Thread Sharon Wallace
inp = raw_input largest = None smallest = None while True: num = raw_input('Enter a number: ') if num = 'done' : break print num try : num = float(inp) except :

Re: [Tutor] Help with Max Number and Min number script

2016-09-16 Thread Joel Goldstick
On Fri, Sep 16, 2016 at 7:08 PM, Sharon Wallace wrote: > inp = raw_input The above doesn't do what you think. It creates a name called inp which is bound to the function raw_input > > largest = None > > smallest = None > > > > while True: > > num =

Re: [Tutor] maximum recursion error

2016-09-16 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
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 -

Re: [Tutor] maximum recursion error

2016-09-16 Thread Peter Otten
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

[Tutor] IDLE hangs after sys.setrecursionlimit(), was Re: maximum recursion error

2016-09-16 Thread Peter Otten
D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > 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) IDLE's commandline emulation needs the