User loginNavigation |
GvR: Rejecting the J2 decorators proposal
Yet another example of language design in action. The specific issues Guido is concerned about are perhaps of less importance than this concluding remark,
A warning: some people have shown examples of extreme uses of decorators. I've seen decorators proposed for argument and return type annotations, and even one that used a decorator to create an object that did a regular expression substitution. Those uses are cute, but I recommend being conservative when deciding between using a decorator or some other approach, especially in code that will see a large audience (like 3rd party library packages). Using decorators for type annotations in particular looks tedious, and this particular application is so important that I expect Python 3000 will have optional type declarations integrated into the argument list. |
Browse archives
Active forum topics |
Recent comments
29 weeks 4 days ago
29 weeks 5 days ago
29 weeks 5 days ago
51 weeks 6 days ago
1 year 4 weeks ago
1 year 5 weeks ago
1 year 5 weeks ago
1 year 8 weeks ago
1 year 12 weeks ago
1 year 12 weeks ago