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 itoijala
Recipients itoijala
Date 2018-10-07.11:46:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538912765.08.0.545547206417.issue34921@psf.upfronthosting.co.za>
In-reply-to
Content
The following example should work but does not.
Note that it does work without the future import.

from __future__ import annotations

import typing

def f() -> typing.NoReturn:
    pass

typing.get_type_hints(f)

Traceback (most recent call last):
  File "foo.py", line 8, in <module>
    typing.get_type_hints(f)
  File "/usr/lib/python3.7/typing.py", line 1001, in get_type_hints
    value = _eval_type(value, globalns, localns)
  File "/usr/lib/python3.7/typing.py", line 260, in _eval_type
    return t._evaluate(globalns, localns)
  File "/usr/lib/python3.7/typing.py", line 466, in _evaluate
    is_argument=self.__forward_is_argument__)
  File "/usr/lib/python3.7/typing.py", line 135, in _type_check
    raise TypeError(f"Plain {arg} is not valid as type argument")
TypeError: Plain typing.NoReturn is not valid as type argument
History
Date User Action Args
2018-10-07 11:46:05itoijalasetrecipients: + itoijala
2018-10-07 11:46:05itoijalasetmessageid: <1538912765.08.0.545547206417.issue34921@psf.upfronthosting.co.za>
2018-10-07 11:46:05itoijalalinkissue34921 messages
2018-10-07 11:46:04itoijalacreate