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

JsonType could be better declared #3519

Open
shughes-uk opened this issue Feb 20, 2025 · 2 comments
Open

JsonType could be better declared #3519

shughes-uk opened this issue Feb 20, 2025 · 2 comments
Assignees

Comments

@shughes-uk
Copy link

shughes-uk commented Feb 20, 2025

Currently y'all declare JsonType:

JsonType = Union[str, int, float, bool, None, Dict[str, Any], List[Any]]

I think would be better declared as

JsonType = Union[str, int, float, bool, None, Mapping[str, "JsonType"], List["JsonType"]]

Any thoughts?

@petyaslavova
Copy link
Collaborator

Hi @shughes-uk, thank you for your feedback! I will work on a json module related issue soon, and I will check if such a change will be appropriate for all possible cases.

@petyaslavova petyaslavova self-assigned this Feb 24, 2025
@shughes-uk
Copy link
Author

There's some solid discussion of it over here on the stdlib typing module python/typing#182 too if you would like some more details.

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

No branches or pull requests

2 participants