From 318d36a1c25ee6007761fadf987f46d7c6ebb003 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 8 Feb 2023 18:49:43 -0500 Subject: [PATCH] add test for #9268 Change-Id: I3075472de51b9d0d429f7f6204093f3e481fc121 --- test/ext/mypy/plain_files/hybrid_two.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/ext/mypy/plain_files/hybrid_two.py b/test/ext/mypy/plain_files/hybrid_two.py index 430d796c60..619bbc839c 100644 --- a/test/ext/mypy/plain_files/hybrid_two.py +++ b/test/ext/mypy/plain_files/hybrid_two.py @@ -89,3 +89,21 @@ if typing.TYPE_CHECKING: # EXPECTED_RE_TYPE: sqlalchemy.*.BinaryExpression\[builtins.bool\*?\] reveal_type(expr3) + +# test #9268 + + +class Foo(Base): + val: bool + + def needs_update_getter(self) -> bool: + return self.val + ... + + def needs_update_setter(self, value: bool) -> None: + self.val = value + + needs_update: hybrid_property[bool] = hybrid_property( + needs_update_getter, + needs_update_setter, + ) -- 2.47.3