-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Implement json.pyi for Python's stdlib #84
Comments
Feel free to add this to the existing stdlib/3/json.pyi stub. Technically it should probably go in the 3.6 version -- you'd have to create a 3.6 subdir, copy json.pyi into it, and then add JSONType there. But we're not very strict about these things, and lots of other modules in stdlib/3 have features that aren't available in all versions from 3.2--3.6. At runtime people can use a trick like if False:
from json import JSONType This way they can use JSONType and still run their code under 3.2--3.5. This would actually suggest that it's better not to introduce a separate 3.6 version. We should also add it to the 2.7. version. |
…graphs to conform to 72 characters per line.
The json stubs in typeshed are fine and the typing issue for adding JSONType was closed with no action, so I don't think there's anything to do here. (Feel free to reopen if you disagree.) |
See python/typing#182 for the discussion. The resulting type of things should be
JSONType = t.Union[str, int, float, bool, None, t.Dict[str, t.Any], t.List[Any]]
(which should end up in Python 3.6: http://bugs.python.org/issue26396).The text was updated successfully, but these errors were encountered: