I've seen some different ways to implement abstract methods, like:
First Method: importing ABC
from abc import ABC
class X(ABC):
@abstractmethod
def abstractmethod(self):
pass
Second method: raise NotImplementedError
class X:
def abstractmethod(self):
raise NotImplementedError
I want to know two different things.
1) Which is the most accepted way to treat abstraction in Python?; and
2) How do I approach this for variables?