On 8/11/06, Collin Winter <[EMAIL PROTECTED]> wrote:
>>> def chain(*decorators):
>>>     assert len(decorators) >= 2
>>>
>>>     def decorate(function):
>>>         sig = function.__signature__
>>>         original = sig.annotations
>>>
>>>         for i, dec in enumerate(decorators):
>>>             fake = dict((p, original[p][i]) for p in original)
>>>
>>>             function.__signature__.annotations = fake
>>>             function = dec(function)
>>>
>>>         function.__signature__.annotations = original
>>>         return function
>>>     return decorate

I must be confused. This is a function returning a function. Does that mean that the thing showing up in the __signatures__ dictionary is a function? Or does the caller need to use two sets of parentheses to call the factory function and then the inner function?

 Paul Prescod


_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to