On Wed, Aug 20, 2014 at 2:13 PM, Paul Moore <p.f.moore@gmail.com> wrote:
On 20 August 2014 18:37, Andrea Censi <censi@mit.edu> wrote:
> What can one do with a decorator that cannot be done with annotations?

Python 2 compatibility.

Out of the way mark-up.  Compare


@types(int, float, returns=float)
def foo(x, y):
  ..

to

def foo(x:int, y:float) -> float:
  ..

The decorator variant is visually closer to plain unannotated Python.