Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PYTHON-5537 Update typing dependencies #2524

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
blink1073 merged 1 commit into mongodb:master from blink1073:PYTHON-5537
Sep 10, 2025

Conversation

Copy link
Member

@blink1073 blink1073 commented Sep 10, 2025

Account for the --strict-bytes parameter added in mypy 1.15, which is enabled by our use of strict=true without explicitly opting out of the behavior.

The only runtime behavior I made was having PyMongoKMSProtocol.read() return bytes, which simplified the code and matched the behavior of PyMongoProtocol.read().

@@ -475,7 +475,7 @@ def test_typeddict_not_required_document_type(self) -> None:
# This should fail because the output is a Movie.
assert out["foo"] # type:ignore[typeddict-item]
# pyright gives reportTypedDictNotRequiredAccess for the following:
assert out["_id"] # type:ignore
assert out["_id"] # type:ignore[unused-ignore]
Copy link
Contributor

@NoahStapp NoahStapp Sep 10, 2025

Choose a reason for hiding this comment

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

What's the purpose of this? # type:ignore[unused-ignore] sounds like an oxymoron.

Copy link
Member Author

@blink1073 blink1073 Sep 10, 2025

Choose a reason for hiding this comment

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

mypy wants to ignore it, pyright does not. 💀

ShaneHarvey reacted with laugh emoji
Copy link
Contributor

@NoahStapp NoahStapp Sep 10, 2025

Choose a reason for hiding this comment

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

classic lol

@blink1073 blink1073 merged commit 527cbdd into mongodb:master Sep 10, 2025
78 of 79 checks passed
@blink1073 blink1073 deleted the PYTHON-5537 branch September 10, 2025 18:28
aclark4life pushed a commit to aclark4life/mongo-python-driver that referenced this pull request Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@NoahStapp NoahStapp NoahStapp approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /