"Steven Bethard" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]:

> On 10/31/07, Fred Drake <[EMAIL PROTECTED]> wrote:
>> If I had to choose built-in names, though, I'd prefer "property",
>> "propset", "propdel".  Another possibility that seems reasonable
>> (perhaps a bit better) would be:
>>
>>    class Thing(object):
>>
>>        @property
>>        def attribute(self):
>>            return 42
>>
>>        @property.set
>>        def attribute(self, value):
>>            self._ignored = value
>>
>>        @property.delete
>>        def attribute(self):
>>            pass
> 
> +1 on this spelling if possible.  Though based on Guido's original
> recipe it might have to be written as::
> 
>       @property.set(attribute)
>       def attribute(self, value):
>           self._ignored = value
> 
It *can* be written as Fred suggested: see 
http://groups.google.co.uk/group/comp.lang.python/browse_thread/thread/b442d08c9a019a8/8a381be5edc26340

However that depends on hacking the stack frames, so the 
implementation probably isn't appropriate here.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to