Commit 95ca4041 authored by Julian Andres Klode's avatar Julian Andres Klode
Browse files

Pacify mypy 0.790 for NotImplemented returns

Mypy 0.790 complains that:

apt/package.py:473: error: Variable "builtins.NotImplemented" is not valid as a type
apt/package.py:473: note: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases

This worked fine in 0.782.

As a workaround, use Any instead of NotImplemented. Ugh

See https://github.com/python/mypy/issues/4791 for more
information.
parent c11bb33c
......@@ -421,7 +421,7 @@ class Version(object):
self.package._pcache._weakversions.add(self)
def _cmp(self, other):
# type: (Any) -> Union[int, NotImplemented]
# type: (Any) -> Union[int, Any]
"""Compares against another apt.Version object or a version string.
This method behaves like Python 2's cmp builtin and returns an integer
......@@ -471,7 +471,7 @@ class Version(object):
return self._cmp(other) < 0
def __ne__(self, other):
# type: (object) -> Union[bool, NotImplemented]
# type: (object) -> Union[bool, Any]
try:
return self._cmp(other) != 0
except TypeError:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment