From a1a0df97c54d3298f2906944a4d284c10ca13ccb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:43:32 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.10.1 → 23.11.0](https://github.com/psf/black/compare/23.10.1...23.11.0) - [github.com/pre-commit/mirrors-mypy: v1.6.1 → v1.7.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.1...v1.7.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0f9d167..8eb684e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 23.11.0 hooks: - id: black args: [--safe, --quiet] @@ -30,7 +30,7 @@ repos: language: python additional_dependencies: [pygments, restructuredtext_lint] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.1 + rev: v1.7.0 hooks: - id: mypy files: ^(src/) From fbcfc06072598b2d552a719d4dffd52e9b8d5147 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 14 Nov 2023 08:29:40 -0300 Subject: [PATCH 2/2] Fix type check errors after updating mypy --- src/oop_ext/foundation/_tests/test_weak_ref.py | 2 +- src/oop_ext/foundation/callback/_callback.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/oop_ext/foundation/_tests/test_weak_ref.py b/src/oop_ext/foundation/_tests/test_weak_ref.py index 45d66b8..14638e4 100644 --- a/src/oop_ext/foundation/_tests/test_weak_ref.py +++ b/src/oop_ext/foundation/_tests/test_weak_ref.py @@ -318,7 +318,7 @@ def CustomAssertEqual(a, b): assert False, "{} != {}".format(a, b) -def SetupTestAttributes(): +def SetupTestAttributes() -> Any: class C: x: int diff --git a/src/oop_ext/foundation/callback/_callback.py b/src/oop_ext/foundation/callback/_callback.py index 94bae5b..0365a39 100644 --- a/src/oop_ext/foundation/callback/_callback.py +++ b/src/oop_ext/foundation/callback/_callback.py @@ -391,7 +391,7 @@ def Contains( real_func: Optional[Callable] = func - if real_func.__class__ == WeakMethodProxy: + if isinstance(real_func, WeakMethodProxy): real_func = cast(WeakMethodProxy, real_func) real_func = real_func.GetWrappedFunction()