[Python-Dev] Questions about '@' in pep 318 (original) (raw)

Phillip J. Eby pje at telecommunity.com
Fri Aug 6 17:11:36 CEST 2004


At 01:07 PM 8/6/04 +0200, M.-A. Lemburg wrote:

1. Instead of trying to overgeneralize, we only allow exactly one decorator per function definition.

Not practical. Since many use cases for multiple decorators exist, restricting the syntax to one simply pushes the issue into functions to combine decorators, further decreasing readability.

2. Since decorators change the definition of a function, that one decorator call is placed directly after the "def" and before the function name.

This makes it difficult to e.g. grep for 'def functionname', and will confuse the heck out of simplistic code scanners, not to mention Tim Peters. :)



More information about the Python-Dev mailing list