Closed ericvsmith closed 7 years ago
In particular, the module-level APIs, which could apply to both data classes and the hypothetical namedtuples.
TBH, I would keep typing.NamedTuple
in typing
. It is already extensively used and has special support in mypy and other type checkers. An additional argument is that soon we will have typing.TypedDict
, and it would be more consistent to have both of them in the same module.
Good point, that slipped my mind. It's a shame we can't harmonize them somehow, like maybe adding field()
support.
It occurs to me that I could also use this mechanism to generate namedtuples. I'm not saying it should happen in this PEP, but it might be worth considering when deciding on names and APIs.