Previously, as pointed out by @jafermarq , the string representation of entire TypedDict will show up when printing out the return of .keys() / .values(), as follows:
To optimize the string representations, I implemented keys(), values() and items() methods for TypedDict instead of just inheriting them from the superclass MutableMapping. Now, we have:
Previously, as pointed out by @jafermarq , the string representation of entire
TypedDict
will show up when printing out the return of.keys()
/.values()
, as follows:To optimize the string representations, I implemented
keys()
,values()
anditems()
methods forTypedDict
instead of just inheriting them from the superclassMutableMapping
. Now, we have: