-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
Description
Bug Report
Stubtest reports cannot reconcile @property on stub with runtime object on functions decorated with cached_property.
To Reproduce
$ cat t.py
from functools import cached_property
class C:
@cached_property
def p(self):
return 1
$ cat t.pyi
from functools import cached_property
class C:
@cached_property
def p(self) -> int: ...
$ PYTHONPATH=. stubtest t
error: t.C.p is inconsistent, cannot reconcile @property on stub with runtime object
Stub: in file /tmp/t.pyi:3
def (self: t.C) -> builtins.int
Runtime:
<functools.cached_property object at 0x7fa3228ce0f0>
Found 1 error (checked 1 module)Expected Behavior
no error
Actual Behavior
error
Your Environment
- Mypy version used: 1.11.1 and github master
- Mypy command-line flags: N/A
- Mypy configuration options from
mypy.ini(and other config files): N/A - Python version used: 3.12
Related: python/typeshed#12153