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/057417.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?Aahz aahz at pythoncraft.com
Tue Oct 18 17:49:00 CEST 2005
On Tue, Oct 18, 2005, Barry Warsaw wrote:
>
> 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?

AttributeError, just like this:

    class C: pass
    C().foo()

Last night I was thinking that maybe TypeError would be better, but
AttributeError is going to be what the internal machinery raises, and I
decided there was no point trying to translate it.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur."  --Red Adair
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