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/2007-November/075098.html below:

[Python-Dev] Declaring setters with getters

[Python-Dev] Declaring setters with getters [Python-Dev] Declaring setters with gettersGreg Ewing greg.ewing at canterbury.ac.nz
Thu Nov 1 23:10:20 CET 2007
Fred Drake wrote:
>        @property
>        def attribute(self):
>            return 42
> 
>        @property.set
>        def attribute(self, value):
>            self._ignored = value

Hmmm... if you were allowed general lvalues as the target of a
def, you could write that as

   def attribute.set(self, value):
     ...

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