Movatterモバイル変換


[0]ホーム

URL:


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

--strict-equality forNone#19718

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ilevkivskyi merged 6 commits intopython:masterfromtyralla:strict_equality_for_none
Aug 30, 2025
Merged
Show file tree
Hide file tree
Changes from2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletionmypy/checkexpr.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3794,7 +3794,9 @@ def dangerous_comparison(
# We suppress the error for equality and container checks if there is a custom __eq__()
# method on either side. User defined (or even standard library) classes can define this
# to return True for comparisons between non-overlapping types.
if (custom_special_method(left, "__eq__") or custom_special_method(right, "__eq__")) and not identity_check:
if (
custom_special_method(left, "__eq__") or custom_special_method(right, "__eq__")
) and not identity_check:
return False

if prefer_literal:
Expand Down
2 changes: 1 addition & 1 deletionmypy/main.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -906,7 +906,7 @@ def add_invertible_flag(
default=False,
strict_flag=True,
help="Prohibit equality, identity, and container checks for non-overlapping types "
"(except `None`)",
"(except `None`)",
group=strictness_group,
)

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp