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/2004-April/044040.html below:

[Python-Dev] PEP 318: Properties

[Python-Dev] PEP 318: PropertiesGreg Ewing greg at cosc.canterbury.ac.nz
Mon Apr 5 01:44:34 EDT 2004
Skip Montanaro <skip at pobox.com>:

>     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?

No, it would wipe out the property descriptor that you'd just
carefully set up.

I don't think this makes sense, anyway. Being a property implies that
its value is computed somehow, so how to establish an initial value,
if that concept even applies, will depend entirely on the details of
how it's being computed.  Sounds like a job for a piece of code in an
__init__ method to me.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+

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