(object)
return False
Return true if the object is an abstract base class (ABC).
Return true if the object is an abstract base class (ABC).
Return true if the object is an abstract base class ( ABC ) .
def isabstract(object):
    """Return true if the object is an abstract base class (ABC)."""
    if not isinstance(object, type):
        return False
    if object.__flags__ & TPFLAGS_IS_ABSTRACT:
        return True
    if not issubclass(type(object), abc.ABCMeta):
        return False
    if hasattr(object, '__abstractmethods__'):
        # It looks like ABCMeta.__new__ has finished running;
        # TPFLAGS_IS_ABSTRACT should have been accurate.
        return False
    # It looks like ABCMeta.__new__ has not finished running yet; we're
    # probably in __init_subclass__. We'll look for abstractmethods manually.
    for name, value in object.__dict__.items():
        if getattr(value, "__isabstractmethod__", False):
            return True
    for base in object.__bases__:
        for name in getattr(base, "__abstractmethods__", ()):
            value = getattr(object, name, None)
            if getattr(value, "__isabstractmethod__", False):
                return True
    return False
def isabstract ( object ) : if not isinstance ( object , type ) : return False if object . __flags__ & TPFLAGS_IS_ABSTRACT : return True if not issubclass ( type ( object ) , abc . ABCMeta ) : return False if hasattr ( object , '__abstractmethods__' ) : # It looks like ABCMeta.__new__ has finished running; # TPFLAGS_IS_ABSTRACT should have been accurate. return False # It looks like ABCMeta.__new__ has not finished running yet; we're # probably in __init_subclass__. We'll look for abstractmethods manually. for name , value in object . __dict__ . items ( ) : if getattr ( value , "__isabstractmethod__" , False ) : return True for base in object . __bases__ : for name in getattr ( base , "__abstractmethods__" , ( ) ) : value = getattr ( object , name , None ) if getattr ( value , "__isabstractmethod__" , False ) : return True return False