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

[Python-Dev] Extended Function syntax

[Python-Dev] Extended Function syntax [Python-Dev] Extended Function syntaxMichael Hudson mwh@python.net
Tue, 28 Jan 2003 12:09:45 +0000
Just van Rossum <just@letterror.com> writes:

> With MWH's patch, this could be:
>
> class Foo(object):
>      class myprop [property]:
>          """A computed property on Foo objects."""
>
>          def __get__(self):
>              return ...
>          def __set__(self):
>              ...
>          def __delete__(self):
>              ...
>
> (with a different definition of property(), though...)

I'm pretty sure you can do this with a metaclass, but I've just spent
half an hour thoroughly confusing myself trying to do so.

I'm not sure I like using 'class' to introduce a propery, FWIW.

Cheers,
M.

-- 
  First of all, email me your AOL password as a security measure. You
  may find that won't be able to connect to the 'net for a while. This
  is normal. The next thing to do is turn your computer upside down
  and shake it to reboot it.                     -- Darren Tucker, asr



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