diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b28207b..5dad849 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: language: python additional_dependencies: [pygments, restructuredtext_lint] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.19.1 + rev: v1.20.0 hooks: - id: mypy files: ^(src/) diff --git a/src/oop_ext/foundation/callback/_callback.py b/src/oop_ext/foundation/callback/_callback.py index b7c0329..08fc16c 100644 --- a/src/oop_ext/foundation/callback/_callback.py +++ b/src/oop_ext/foundation/callback/_callback.py @@ -55,7 +55,6 @@ def on_x(x: int) -> None: from typing import Optional from typing import Tuple from typing import Union -from typing import cast import attr import functools @@ -189,7 +188,6 @@ def _GetKey( is garbage collected, a new function may end up having the same key. """ if func.__class__ == _CallbackWrapper: - func = cast(_CallbackWrapper, func) func = func.OriginalMethod() try: @@ -224,7 +222,6 @@ def _GetInfo( # at this point, but if it's a WeakMethodProxy, register the original method (we'll make a # weak reference later anyways). if func.__class__ == WeakMethodProxy: - func = cast(WeakMethodProxy, func) func = func.GetWrappedFunction() if _IsCallableObject(func):