Skip to content

Commit

Permalink
add back ignore with comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Dec 22, 2023
1 parent c5e5209 commit 4b73d10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ ignore_errors = true
module = ["wrapt", "msgspec"]
ignore_missing_imports = true

# TODO: this can probably be removed once we drop support for 3.7
[[tool.mypy.overrides]]
module = ["psygnal._signal"]
warn_unused_ignores = false

# https://coverage.readthedocs.io/en/6.4/config.html
[tool.coverage.report]
exclude_lines = [
Expand Down
7 changes: 6 additions & 1 deletion src/psygnal/_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,12 @@ def _wrapper(
extra = f"- Slot types {slot_sig} do not match types in signal."
self._raise_connection_error(slot, extra)

cb = weak_callback(
# this type ignore could be fixed with ParamSpec, but that's not yet
# supported by mypyc. we need cb to be a WeakCallback[R], but we can't
# preserve the full typing information of the callback without using
# Callable[ParamSpec, R] or a general TypeVar('F', bound=Callable).
# note: this ignore is only needed for mypyc on python 3.7
cb = weak_callback( # type: ignore [var-annotated]
slot,
max_args=max_args,
finalize=self._try_discard,
Expand Down

0 comments on commit 4b73d10

Please sign in to comment.