class BaseClass: # Py3 def __new__(cls, *args, **kwargs): if cls is BaseClass: raise TypeError(f"only children of '{cls.__name__}' may be instantiated") return object.__new__(cls, *args, **kwargs)