On Wed, Aug 20, 2014 at 12:51 PM, Alexander Belopolsky <alexander.belopolsky@gmail.com> wrote:
What can one do with an annotation that one cannot do with a decorator?
Spell "returns" in two characters.
True. (Is there any alternative to using a "returns" argument in the decorator?) We can also compile another list: What can one do with a decorator that cannot be done with annotations? 1) Comment out type checking with one character. (Admittedly, this is thinking short term --- it's a limitation of the editors rather than the language itself. We can imagine that language-aware editors of the future will be more flexible. For example, the editor would have a shortcut to hide or disable type annotations.) 2) Easily parse (with your eyes) the function signature without having to think about types. ... A.