-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
false-positivemypy gave an error on correct codemypy gave an error on correct codefeaturepriority-2-lowtopic-descriptorsProperties, class vs. instance attributesProperties, class vs. instance attributestopic-python2issues only applicable to Python 2issues only applicable to Python 2
Description
This doesn't work (reported by Tim Abbott):
class C:
def __init__(self) -> None:
self._x = 0
@property
def x(self) -> int:
return self._x
@x.setter
def set_x(self, value: int) -> None: # Note the name of the method! "def x" works.
self._x = valueThis example seems to be only valid in Python 2, not Python 3.
(Originally reported in #220 (comment).)
Metadata
Metadata
Assignees
Labels
false-positivemypy gave an error on correct codemypy gave an error on correct codefeaturepriority-2-lowtopic-descriptorsProperties, class vs. instance attributesProperties, class vs. instance attributestopic-python2issues only applicable to Python 2issues only applicable to Python 2