[Python-Dev] Re: Re: PEP 318: Decorators last before colon
Guido van Rossum
guido at python.org
Thu Apr 1 11:36:15 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?)
Deconstructing a function like that is too invasive -- I don't want to
touch the calling sequence, for example, because it's so performance
critical. None of the people arguing for decorators has shown a use
case for that either. However, if you really want to do that, you
*can* take the function apart and construct a new one using the 'new'
module.
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list