This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author aroberge
Recipients aroberge
Date 2020-08-05.14:25:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1596637510.96.0.457695576567.issue41488@roundup.psfhosted.org>
In-reply-to
Content
The following code is currently consistent with the type hint syntax but contains a line that is completely ignored.

   >>> d = {}
   >>> d['a']: int
   >>> d
   {}
   >>> __annotations__
   {}
    >>> '__annotations__' in dir(d)
   False

I believe that type hints that cannot be either attached to an object nor added to any other __annotations__ dict should either generate a SyntaxError or, at the very least, result in a warning.
History
Date User Action Args
2020-08-05 14:25:11arobergesetrecipients: + aroberge
2020-08-05 14:25:10arobergesetmessageid: <1596637510.96.0.457695576567.issue41488@roundup.psfhosted.org>
2020-08-05 14:25:10arobergelinkissue41488 messages
2020-08-05 14:25:10arobergecreate