A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-October/057412.html below:

[Python-Dev] Definining properties - a use case for class decorators?

[Python-Dev] Definining properties - a use case for class decorators? [Python-Dev] Definining properties - a use case for class decorators?Barry Warsaw barry at python.org
Tue Oct 18 16:57:01 CEST 2005
On Mon, 2005-10-17 at 23:46, Guido van Rossum wrote:

> But I still like the version with strings better:
> 
>     x = property('get_x', 'set_x')
> 
> This trades two lambdas for two pairs of string quotes; a good deal IMO!

You could of course "just" do the wrapping in property().  I put that in
quotes because you'd have the problem of knowing when to wrap and when
not to, but there would be ways to solve that.  But I won't belabor the
point any longer, except to ask what happens when you typo one of those
strings?  What kind of exception do you get and when do you get it?

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20051018/21468041/attachment.pgp
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4