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.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

optional type?

I wonder what does GvR mean as type :)

Anyway it's worth noting this move towards soft typing in the dynamic language world.. perl6 will have it, matz is looking for good ideas to put in Ruby2, Python3k should have something, and even php5 has it.
Everything will end up with a lisp-like soft type system?

And then...

And then they'll want some static guarantees. Then they will discover that some features are harder to check statically than others, and given enough time they'll rediscover the current state of the art...

Argh, this post again...

I think "digest" is a better word than "rediscover", since the state of the art won't make it into these languages in some pure form. The "current state of the art" has an analogous task of digesting the popular dynamic languages' (admittedly nebulous, hard to enumerate, and inseparably mixed with inertia) practical innovations. The PLT-Scheme folks seem most active in doing this, with the most recent manifestation being their PLaneT module distribution thingy. I don't think it's obvious which of these digestive processes is faster.