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 sransara
Recipients gvanrossum, kj, python-dev, sransara, toburger
Date 2021-09-06.12:18:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630930694.41.0.701691323247.issue44863@roundup.psfhosted.org>
In-reply-to
Content
My initial intention to create this ticket was to explore the idea that if we could side step from creating a PEP or updating PEP-589.

IMO only contribution from a new PEP will be:
1. relaxing this line from PEP-589 and be explicit to include Generic: "A TypedDict cannot inherit from both a TypedDict type and a non-TypedDict base class." (IMO by thinking `Generic` as a mixin even this is not needed)
2. may be syntax for generic in the alternative syntax (side note: collecting typevars from the values is hard to implement because of forward refs)
3. Some explicit generic examples for good measure

I believe PEP-589 is complete in covering all semantic details even with Generics. Even structural subtyping because it says: "Value types behave invariantly, since TypedDict objects are mutable."

My understanding was that during initial implementation this was not done for the sake of implementation simplicity (days before PEP-560).

All that said, a new PEP would be a good way to notify the type checkers of this capability.

Is there a better place to have this conversation?
History
Date User Action Args
2021-09-06 12:18:14sransarasetrecipients: + sransara, gvanrossum, python-dev, kj, toburger
2021-09-06 12:18:14sransarasetmessageid: <1630930694.41.0.701691323247.issue44863@roundup.psfhosted.org>
2021-09-06 12:18:14sransaralinkissue44863 messages
2021-09-06 12:18:14sransaracreate