[New-bugs-announce] [issue44642] Union of a type and the typing module function

Serhiy Storchaka report at bugs.python.org
Thu Jul 15 03:58:18 EDT 2021


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

The union type accepts any function from the typing module:

>>> import typing
>>> int | typing.cast
int | typing.cast
>>> int | typing.get_type_hints
int | typing.get_type_hints

It is a consequence of too lenient check for the typing.NewType() result (which does not work at all with PR 9951).

----------
components: Interpreter Core
messages: 397528
nosy: gvanrossum, kj, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Union of a type and the typing module function
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44642>
_______________________________________


More information about the New-bugs-announce mailing list