do you how to combine this with abstract classes? If I do the following:
from dataclasses import dataclass, field from abc import abstractmethod @dataclass # type: ignore class Vehicle: wheels: int _wheels: int = field(init=False, repr=False) @property def wheels(self) -> int: print('getting wheels') return self._wheels @wheels.setter def wheels(self, wheels: int): print('setting wheels to', wheels) self._wheels = wheels @abstractmethod def sound_horn(self): raise NotImplementedError
then I get the warning test.py:10: error: Name 'wheels' already defined on line 7
test.py:10: error: Name 'wheels' already defined on line 7
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
do you how to combine this with abstract classes? If I do the following:
then I get the warning
test.py:10: error: Name 'wheels' already defined on line 7