Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass mypy and link issues #17

Merged
merged 1 commit into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading