Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map type arguments aren't introspectible in runtime #83

Closed
Tinche opened this issue May 4, 2022 · 0 comments
Closed

Map type arguments aren't introspectible in runtime #83

Tinche opened this issue May 4, 2022 · 0 comments

Comments

@Tinche
Copy link

Tinche commented May 4, 2022

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.

eltoder added a commit to eltoder/immutables that referenced this issue Mar 4, 2023
Also make pure python implementation generic for consistency.

Closes MagicStack#83
eltoder added a commit to eltoder/immutables that referenced this issue Jul 22, 2023
eltoder added a commit to eltoder/immutables that referenced this issue Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant