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
Changes from1 commit
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
PrevPrevious commit
NextNext commit
add option--strict-equality-for-none
  • Loading branch information
@tyralla
tyralla committedAug 28, 2025
commit7e8cb1c188cfee040c7f8efdd09bebdae128c2a1
15 changes: 14 additions & 1 deletiondocs/source/command_line.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -728,9 +728,22 @@ of the above sections.
if text != b'other bytes': # Error: non-overlapping equality check!
...

assert text is not None # OK, check against None is allowedas a special case.
assert text is not None # OK, check against None is allowedfor historical reasons.


.. option:: --strict-equality-for-none

This flag extends :option:`--strict-equality <mypy --strict-equality>` for checks
against ``None``:

.. code-block:: python

text: str
assert text is not None # Error: non-overlapping identity check!

Note that :option:`--strict-equality-for-none <mypy --strict-equality-for-none>`
only works in combination with :option:`--strict-equality <mypy --strict-equality>`.

.. option:: --strict-bytes

By default, mypy treats ``bytearray`` and ``memoryview`` as subtypes of ``bytes`` which
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp