immutables
immutables copied to clipboard
Map type arguments aren't introspectible in runtime
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.