[Python-Dev] PEP 318: Let's propose some useful built-in decorators (original) (raw)
Guido van Rossum guido at python.org
Fri Apr 2 15:08:03 EST 2004
- Previous message: [Python-Dev] PEP 318: Let's propose some useful built-in decorators
- Next message: [Python-Dev] PEP 318: Let's propose some useful built-in decorators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> class funcattrs(objects): > > def init(self, **kwds): > self.attrs = kwds > > def call(self, funcobj): > funcobj.dict.update(self.attrs) > Did you leave out the 'return funcobj' from the end of call? I thought that decorators were supposed to be inherently cooperative, and should return their modified funcobj, or a new func-like-obj.
Sorry, you're right. (I've been thinking of interpreting a None result as "keep the input object" but the code generation would be too messy.
--Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] PEP 318: Let's propose some useful built-in decorators
- Next message: [Python-Dev] PEP 318: Let's propose some useful built-in decorators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]