Author gvanrossum
Recipients adelfino, cheryl.sabella, docs@python, gvanrossum, levkivskyi, matrixise, r.david.murray
Date 2018-05-14.19:45:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526327113.24.0.682650639539.issue32769@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-05-14 19:45:13gvanrossumsetrecipients: + gvanrossum, r.david.murray, docs@python, matrixise, levkivskyi, cheryl.sabella, adelfino
2018-05-14 19:45:13gvanrossumsetmessageid: <1526327113.24.0.682650639539.issue32769@psf.upfronthosting.co.za>
2018-05-14 19:45:13gvanrossumlinkissue32769 messages
2018-05-14 19:45:13gvanrossumcreate