39
40
41def sqlite_datetime_fix():
42 class SQLiteDateTimeType(types.TypeDecorator):43 impl = types.Integer
44 epoch = datetime(1970, 1, 1, 0, 0, 0)
45
39
40
41def sqlite_datetime_fix():
42 class SQLiteDateTimeType(types.TypeDecorator):43 impl = types.Integer
44 epoch = datetime(1970, 1, 1, 0, 0, 0)
45
A method marked with @abstractmethod
is not defined in the concrete class. This can result in unintended behavior.
It is recommended to implement all abstract methods in the derived classes.
from abc import ABC, abstractmethod
class Vehicle(ABC):
@abstractmethod
def start():
pass
class Car(Vehicle):
# No overridden `start` method here. Can cause unintended behavior
def stop():
self.speed = 0
from abc import ABC, abstractmethod
class Vehicle(ABC):
@abstractmethod
def start():
pass
class Car(Vehicle):
def start():
self.speed = 3
def stop():
self.speed = 0