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:
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
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