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/2003-January/032557.html below:

[Python-Dev] Extended Function syntax

[Python-Dev] Extended Function syntax [Python-Dev] Extended Function syntaxThomas Heller theller@python.net
30 Jan 2003 21:01:05 +0100
holger krekel <pyth@devel.trillke.net> writes:

> IMO none of the new syntax ideas really have much appeal.

I have the same feeling.

> 
> One way to define lightweight properties today is something like
> 
>     foo = property(
>             lambda s: s.__dict__.get('_foo_', 42),
>             lambda s,x: s.__dict__.__setitem__('_foo_', x),
>             lambda s: s.__dict__.__delitem__('_foo_'),
>             "foo property"
>           )

and this is something I actually have done, for readonly computed
properties (without docstring), where this is reduced to

    foo = property(lambda self: self._bar)

All in all, I'm not so unhappy with the current way.

Thomas




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