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

[Python-Dev] pep 318, Decorators for Functions, Methods and Classes

[Python-Dev] pep 318, Decorators for Functions, Methods and ClassesPhillip J. Eby pje at telecommunity.com
Fri Aug 6 20:21:07 CEST 2004
At 08:55 AM 8/6/04 -0700, Guido van Rossum wrote:
>It would seem that the functionality isn't quite as useful there; you
>can get most of the same effects with metaclasses.  I'm not aware of
>any idiom that takes a class and passes it through some kind of
>wrapper or transformation *after* the class declaration; if somebody
>is using this, it surely must be a very rare use indeed.

Zope and PyProtocols use this approach for inline interface declarations, 
though it's implemented by _getframe and a temporary metaclass.  E.g. Zope's:

class Foo:
     implements(IFoo)

works by effectively applying a decorator to the finished 
class.  PyProtocols doesn't change the class in the process, but I think 
Zope might (e.g. to set __implements__).

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