Skip to content

Conversation

@blink1073
Copy link
Member

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().

@blink1073 blink1073 requested a review from NoahStapp September 10, 2025 17:22
@blink1073 blink1073 requested a review from a team as a code owner September 10, 2025 17:22
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

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

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. 💀

Copy link
Contributor

Choose a reason for hiding this comment

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

classic lol

@blink1073 blink1073 requested a review from NoahStapp September 10, 2025 17:43
@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
@blink1073
Copy link
Member Author

drivers-pr-bot please backport to v4.15

mongodb-dbx-release-bot bot pushed a commit that referenced this pull request Sep 16, 2025
blink1073 added a commit that referenced this pull request Sep 16, 2025
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
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