[Python-Dev] Declaring setters with getters

Christian Heimes lists at cheimes.de
Sat Nov 10 22:43:21 CET 2007


Guido van Rossum wrote:
> Which is sometimes convenient. But thinking about this some more I
> think that if I *wanted* to use the same method as setter and deleter,
> I could just write
> 
> @foo.setter
> @foo.deleter
> def foo(self, value=None): ...
> 
> So I'm withdrawing the hacks, making the code and semantics much simpler.

I like the new way better than the implicit magic of your former patch.
(*) I've reviewed your patch and I found a minor typo caused by copy and
paste.

Good work Guido!

Christian

(*) The buzz words 'implicit' and 'magic' are used in this posting to
make Guido's non-pythonic-code-sense tingle. *scnr* :]



More information about the Python-Dev mailing list