class BaseClass(object):

    def __new__(cls, *args, **kwargs):
        if cls is BaseClass:
            raise TypeError('base class may not be instantiated')
return object.__new__(cls, *args, **kwargs)
Preventing a class from direct instantiation in Python