A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-April/044029.html below:

[Python-Dev] PEP 318: Properties

[Python-Dev] PEP 318: Properties [Python-Dev] PEP 318: PropertiesGuido van Rossum guido at python.org
Sun Apr 4 20:19:30 EDT 2004
> >> How would this be interpreted?
>  
> >>     x = 42
>  
> >>    def x(self) [propget]:
> >>        "Doc string for x"
> >>        return self.__x
> 
> >> That is, there is already an (otherwise invalid) 'x' in the calling scope
> >> when propget() is called.  Do the property doodads just need to be
> >> bulletproofed or should an exception be raised?
> 
> Guido:
> 
> > It's broken.  I expect this to raise an exception at some point.
> > Beyond that, who cares?
> 
> If so, then this decorator is a bad idea.
> 
> I would expect 42 to be the initial value of the property x.

Then I think you have much to learn about properties.

--Guido van Rossum (home page: http://www.python.org/~guido/)

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