New submission from Terry Davis <terry.y.da...@gmail.com>:
There should be a builtin alias for `Type[NamedTuple]` so that library authors user-supplied `NamedTuple`s can properly type-check their code. Here's a code sample that causes an issue in my IDE (PyCharm) ******************************** from typing import NamedTuple, Type def fun(NT: NamedTuple, fill): # Complains that NamedTuple is not callable nt = NT(*fill) return nt UserNamedTuple = Type[NamedTuple] def fun(NT: UserNamedTuple, fill): # No complaints nt = NT(*fill) return nt ******************************** This could just be an issue with PyCharm (I don't use mypy), but the correct to annotate this is with a Type[NamedTuple], so I hope mypy et. al. wouldn't this as a special case... ---------- components: Library (Lib) messages: 339893 nosy: Terry Davis priority: normal severity: normal status: open title: Should be a typing.UserNamedTuple type: enhancement _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36591> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com