from abc import ABC, abstractmethod
class Foo(ABC):
@classmethod
def foo(cls) -> Foo:
return cls()
@abstractmethod
def bar(self) -> None:
...
Foo.foo() # no error
playground
most of the time, classmethods are instantiating the class, so it should not allow you to call them on abstract classes.
i do however think staticmethods should still be allowed as they do not have access to the cls
playground
most of the time,
classmethods are instantiating the class, so it should not allow you to call them on abstract classes.i do however think
staticmethods should still be allowed as they do not have access to thecls