8000 Loosen constraints on ujson file functions by tjstum · Pull Request #10081 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Loosen constraints on ujson file functions #10081

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

Merged
merged 2 commits into from
Apr 25, 2023
Merged

Conversation

tjstum
Copy link
Contributor
@tjstum tjstum commented Apr 24, 2023

Like json.dump, ujson.dump takes any object that has a string-accepting .write method.

Similarly, ujson.load works with any object with a .read() that returns either a string or a bytes

Like `json.dump`, `ujson.dump` takes any object that has a
string-accepting `.write` method.

Similarly, `ujson.load` works with any object with a `.read()` that
returns either a string or a bytes
@github-actions

This comment has been minimized.

Copy link
Member
@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood AlexWaygood merged commit 9abf620 into python:main Apr 25, 2023
@@ -47,6 +47,6 @@ def dump(
) -> None: ...
def decode(s: AnyStr, precise_float: bool = ...) -> Any: ...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexWaygood should I also remove these (since they aren't being used as a TypeVar)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they look incorrect. I didn't want to ask you to change them in this PR since they are unrelated to the change you were making, but a followup PR fixing these would be welcome! :)

@tjstum tjstum deleted the ujson branch April 26, 2023 23:18
tjstum added a commit to tjstum/typeshed that referenced this pull request Apr 26, 2023
JelleZijlstra pushed a commit that referenced this pull request May 1, 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 this pull request may close these issues.

2 participants
0