def has_own_init(class_):
    """Return True if class defines its own __init__ method.

    ### parameters

    class_ (python custom class)
        it is verified if this class defines its own
        __init__ method

    ### discussion

    All classes have constructors which are either:
        1) defined by themselves (regardless if it overrides
           completely or just extends the superclass
           __init__);
        2) defined by the superclass;

    This function returns True in the first scenario.

    ### docstests

    >>> class Obj: pass
    >>> has_own_init(Obj)
    False
    >>> class OtherObj:
    ...     def __init__(self): pass
    ...
    >>> has_own_init(OtherObj)
    True
    >>> has_own_init(object)
    True
    """
    class_init = class_.__init__

    ### try retrieving the superclass
    try:
        superclass = class_.__bases__[0]

    ### considering the class has an init but it doesn't
    ### have a superclass, then we assume the init is its
    ### own;
    except IndexError:
        return True

    ### if you succeed, retrieve its constructor
    else:
        superclass_init = superclass.__init__

    ### return the inequality comparison of the inits
    return class_init != superclass_init
Return True if class defines its own __init__ method.

    ### parameters

    class_ (python custom class)
        it is verified if this class defines its own
        __init__ method

    ### discussion

    All classes have constructors which are either:
        1) defined by themselves (regardless if it overrides
           completely or just extends the superclass
           __init__);
        2) defined by the superclass;

    This function returns True in the first scenario.

    ### docstests

    >>> class Obj: pass
    >>> has_own_init(Obj)
    False
    >>> class OtherObj:
    ...     def __init__(self): pass
    ...
    >>> has_own_init(OtherObj)
    True
    >>> has_own_init(object)
    True
    
nodezator/ourstdlibs/meta.py