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 serhiy.storchaka
Recipients gvanrossum, levkivskyi, serhiy.storchaka
Date 2020-04-04.21:20:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1586035239.71.0.90938203594.issue40187@roundup.psfhosted.org>
In-reply-to
Content
typing.TypedDict is used in two ways.

1. It is a callable which produces a new pseudo-subtype of dict.
2. It can also be used as a base in the class statement for creating a new pseudo-subtype of dict.

In both cases it is not a real class. You cannot create an instance of TypedDict or its "subclass". isinstance() and issubclass() do not work with it. Instantiating it "subclass" always returns a dict. But it is implemented as a class, and help() shows methods and data descriptors for it, which are useless.

The proposed PR implements TypedDict as a function. It adds the __mro_entries__ method that allows to use it as a base in the class statement.
History
Date User Action Args
2020-04-04 21:20:39serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, levkivskyi
2020-04-04 21:20:39serhiy.storchakasetmessageid: <1586035239.71.0.90938203594.issue40187@roundup.psfhosted.org>
2020-04-04 21:20:39serhiy.storchakalinkissue40187 messages
2020-04-04 21:20:39serhiy.storchakacreate