Skip to content

Commit

Permalink
Pass mypy and link issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Aug 25, 2024
1 parent d5de39b commit 30fbb59
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions jaraco/collections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ def _dispatch(obj: _Matchable) -> Callable:
# (https://peps.python.org/pep-0443/#abstract-base-classes).
if isinstance(obj, re.Pattern):
return obj.fullmatch
if not isinstance(obj, Callable): # type: ignore
# mypy issue: https://github.com/python/mypy/issues/11071
if not isinstance(obj, Callable): # type: ignore[arg-type]
if not isinstance(obj, Container):
obj = set(obj) # type: ignore
obj = set(obj) # type: ignore[arg-type]
obj = obj.__contains__
return obj # type: ignore
return obj # type: ignore[return-value]


class Projection(collections.abc.Mapping):
Expand Down Expand Up @@ -880,7 +881,7 @@ def __contains__(self, other):
return True


class InstrumentedDict(collections.UserDict): # type: ignore # buggy mypy
class InstrumentedDict(collections.UserDict):
"""
Instrument an existing dictionary with additional
functionality, but always reference and mutate
Expand Down Expand Up @@ -983,8 +984,7 @@ def pop_all(items):
return result


# mypy disabled for pytest-dev/pytest#8332
class FreezableDefaultDict(collections.defaultdict): # type: ignore
class FreezableDefaultDict(collections.defaultdict):
"""
Often it is desirable to prevent the mutation of
a default dict after its initial construction, such
Expand Down
4 changes: 4 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ explicit_package_bases = True

# Disable overload-overlap due to many false-positives
disable_error_code = overload-overlap

# jaraco/jaraco.text#17
[mypy-jaraco.text.*]
ignore_missing_imports = True
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,3 @@ type = [


[tool.setuptools_scm]


[tool.pytest-enabler.mypy]
# Disabled due to jaraco/skeleton#143

0 comments on commit 30fbb59

Please sign in to comment.