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/044028.html below:

[Python-Dev] PEP 318: Properties

[Python-Dev] PEP 318: Properties [Python-Dev] PEP 318: PropertiesSkip Montanaro skip at pobox.com
Sun Apr 4 20:13:45 EDT 2004
    Skip> x = 42
 
    Skip> def x(self) [propget]:
    Skip>   "Doc string for x"
    Skip>   return self.__x

    Guido> It's broken.  I expect this to raise an exception at some point.
    Guido> Beyond that, who cares?

    Jim> If so, then this decorator is a bad idea.

    Jim> I would expect 42 to be the initial value of the property x.

Then it makes sense to put "x = 42" after the three property definitions
(before the end of the class definition).  Would that work?

Skip

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