You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although reveal_type claims that @property objects are simply callables of the type of function they decorate, mypy does know that they have setter and getter attributes. However, if they are used inside a contextmanager, they lose this special property (although it obviously remains so at runtime):
main.py:14: error: "Callable[[X], int]" has no attribute "setter" [attr-defined]
main.py:19: error: Property "a" defined in "X" is read-only [misc]
Found 2 errors in 1 file (checked 1 source file)
The text was updated successfully, but these errors were encountered:
Bug Report
Although
reveal_type
claims that@property
objects are simply callables of the type of function they decorate, mypy does know that they havesetter
andgetter
attributes. However, if they are used inside a contextmanager, they lose this special property (although it obviously remains so at runtime):To Reproduce
https://mypy-play.net/?mypy=latest&python=3.11&gist=31b6919b60f665c999edc543233c3484
Expected Behavior
I'd expect neither of the errors here.
Actual Behavior
The text was updated successfully, but these errors were encountered: