File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -728,9 +728,22 @@ of the above sections.
728728 if text != b ' other bytes' : # Error: non-overlapping equality check!
729729 ...
730730
731- assert text is not None # OK, check against None is allowed as a special case .
731+ assert text is not None # OK, check against None is allowed for historical reasons .
732732
733733
734+ .. option :: --strict-equality-for-none
735+
736+ This flag extends :option: `--strict-equality <mypy --strict-equality> ` for checks
737+ against ``None ``:
738+
739+ .. code-block :: python
740+
741+ text: str
742+ assert text is not None # Error: non-overlapping identity check!
743+
744+ Note that :option: `--strict-equality-for-none <mypy --strict-equality-for-none> `
745+ only works in combination with :option: `--strict-equality <mypy --strict-equality> `.
746+
734747.. option :: --strict-bytes
735748
736749 By default, mypy treats ``bytearray `` and ``memoryview `` as subtypes of ``bytes `` which
You can’t perform that action at this time.
0 commit comments