-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
mypy 1.0 was released back in February: https://mypy-lang.blogspot.com/2023/02/mypy-10-released.html
pymongo fails type checking with mypy 1.2.0:
mypy --install-types --non-interactive bson gridfs tools pymongo bson/son.py: note: In member "__new__" of class "SON": bson/son.py:69: error: Value of type variable "Self" of "__new__" of "dict" cannot be "SON[_Key, _Value]" [type-var] instance = super(SON, cls).__new__(cls, *args, **kwargs) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bson/son.py: note: At top level: bson/son.py:118: error: Unused "type: ignore" comment def setdefault(self, key: _Key, default: _Value) -> _Value: # type: ignore[override] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bson/decimal128.py: note: In function "_decimal_to_128": bson/decimal128.py:103: error: Unsupported operand types for + ("Literal['n']" and "int") [operator] biased_exponent = exponent + _EXPONENT_BIAS ^~~~~~~~~~~~~~ bson/decimal128.py:103: error: Unsupported operand types for + ("Literal['N']" and "int") [operator] biased_exponent = exponent + _EXPONENT_BIAS ^~~~~~~~~~~~~~ bson/decimal128.py:103: error: Unsupported operand types for + ("Literal['F']" and "int") [operator] biased_exponent = exponent + _EXPONENT_BIAS ^~~~~~~~~~~~~~ bson/decimal128.py:103: note: Left operand is of type "Union[int, Literal['n', 'N', 'F']]" Found 5 errors in 2 files (checked 84 source files)
- is related to
-
PYTHON-3698 Support mypy --strict testing
- Blocked
- related to
-
PYTHON-3686 Test Failure - Mypy tests failing (avoid using stub file for codec options namedtuple generic workaround)
- Closed