Re: Externally-defined properties?

2005-08-25 Thread Michele Simionato
Well, I have used factories of properties external to the class many times, and they work pretty well. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Externally-defined properties?

2005-08-24 Thread Terry Hancock
Frankly, I was surprised this worked at all, but I tried creating a property outside of a class (i.e. at the module level), and it seems to behave as a property: def get_x(ob): ... global x ... return str(x) ... def set_x(ob, value): ... global x ... x = int(value) ... def

Re: Externally-defined properties?

2005-08-24 Thread Bengt Richter
On Wed, 24 Aug 2005 01:15:03 -0500, Terry Hancock [EMAIL PROTECTED] wrote: Frankly, I was surprised this worked at all, but I tried creating a property outside of a class (i.e. at the module level), and it seems to behave as a property: def get_x(ob): ... global x ... return str(x) ...

Re: Externally-defined properties?

2005-08-24 Thread Scott David Daniels
Terry Hancock wrote: Frankly, I was surprised this worked at all, but I tried creating a property outside of a class (i.e. at the module level), and it seems to behave as a property: Not so surprising. Making a class begins by making a little namespace, then using it to build the class. If