I have a class like this
from abc import ABC
class AbstractFoo(ABC):
# Subclasses are expected to specify this
# Yes, this is a class attribute, not an instance attribute
bar: list[str] = NotImplemented
# for example
class SpecialFoo(AbstractFoo):
bar = ["a", "b"]
But this does not feel particularly clean and perhaps a little confusing. Importantly, the bar
attribute is nowhere marked as abstract, so it could be still possible to instantiate it without being specified. Is there a better way to achieve a similar behavior?