Re: [Tutor] property built-in

2006-10-19 Thread John Fouhy
On 20/10/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > wesley chun wrote: > > on a related note, if you're using Python 2.4 and newer, you can > > simplfy your code a bit by replacing the call to property() with a > > decorator for x, as in: > > > > @property > > def x(): > > : > > I don't thin

Re: [Tutor] property built-in

2006-10-19 Thread Kent Johnson
wesley chun wrote: >>> x= property(**x()) >>> >>> questions: >>> 1: why doesn't there have to be a self in x()? >> x is not a "normal" class method. It is only used as a container to >> hold the "real" methods which are returned in the locals() dictionary. > > > on a related note, if you

Re: [Tutor] property built-in

2006-10-19 Thread wesley chun
> > x= property(**x()) > > > > questions: > > 1: why doesn't there have to be a self in x()? > > x is not a "normal" class method. It is only used as a container to > hold the "real" methods which are returned in the locals() dictionary. on a related note, if you're using Python 2.4 and

Re: [Tutor] property built-in

2006-10-19 Thread Python
On Thu, 2006-10-19 at 19:03 +0200, thomas wrote: > Hi, > > > I was wondering some things about property. > > suppose I have a class like this: > > class A(object): > def __init__(self, x, y): >self.__x = x > > def x(): >def get(self): fget > retur