◐ Shell
clean mode source ↗

Message 316564 - Python tracker

Before we backport this to 3.7 and 3.6, let's iterate on the wording a bit.

I don't think the distinction between annotations and type hints is that annotations are materialized at runtime while type hints aren't. I think syntactically they are the same, but annotations are a slightly more general concept because they may be used for other purposes than to indicate the type of a variable (or argument, attribute etc.).

So IMO in

  def f():
      x: int

'int' is both an annotation and a type hint, OTOH in

  x: 'spam eggs ham'

we have an annotation that is not a type hint.