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

[Python-Dev] Re: Re: PEP 318: Decorators last before colon

[Python-Dev] Re: Re: PEP 318: Decorators last before colonSkip Montanaro skip at pobox.com
Thu Apr 1 13:05:59 EST 2004
    >> (Has any consideration been given to an actual metafunc mechanism
    >> more directly analogous to metaclasses, that would be given the
    >> *pieces* of a would-be function (name, param names, default args,
    >> code body, etc), so that there would not necessarily ever be a
    >> standard function object?)

    Guido> Deconstructing a function like that is too invasive -- I don't
    Guido> want to touch the calling sequence, for example, because it's so
    Guido> performance critical.  None of the people arguing for decorators
    Guido> has shown a use case for that either.  However, if you really
    Guido> want to do that, you *can* take the function apart and construct
    Guido> a new one using the 'new' module.

One thing that occurred to me is that a function's func_name attribute might
be made read-write so that decorator functions can easily make that aspect
of a function wrapper behave the same as the original function.  Calling
new.function() shouldn't be required in such simple cases.

Skip

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