Currently I don't see a way of getting the key and value types from a map type. Ideally, the Map.__class_getitem__ should return an object with __origin__ set to Map and __args__ set to a tuple of the key and value types, so that typing.get_origin() and typing.get_args() work with it.
Without this information, libraries like cattrs have no way of correctly serializing and deserializing Map instances.
Currently I don't see a way of getting the key and value types from a map type. Ideally, the
Map.__class_getitem__
should return an object with__origin__
set toMap
and__args__
set to a tuple of the key and value types, so thattyping.get_origin()
andtyping.get_args()
work with it.Without this information, libraries like cattrs have no way of correctly serializing and deserializing
Map
instances.