Calling an abstract @classmethod on the ABC class directly should be an error (no concrete implementation exists).
from abc import ABC, abstractmethod
class Factory(ABC):
@classmethod
@abstractmethod
def create(cls) -> "Factory":
raise NotImplementedError
Factory.create()
Sandbox: Pyrefly
Calling an abstract
@classmethodon the ABC class directly should be an error (no concrete implementation exists).Sandbox: Pyrefly