(node)
return (
        node.parent
        and isinstance(node.parent.scope(), astroid.nodes.ClassDef)
        and node.name == "__init__"
    )
Check if the function is a constructor.

    :param node: The node to check.
    :type node: astroid.nodes.FunctionDef

    :returns: True if the function is a constructor, False otherwise.
    :rtype: bool
Check if the function is a constructor.
Check if the function is a constructor .
def is_constructor(node):
    """Check if the function is a constructor.

    :param node: The node to check.
    :type node: astroid.nodes.FunctionDef

    :returns: True if the function is a constructor, False otherwise.
    :rtype: bool
    """
    return (
        node.parent
        and isinstance(node.parent.scope(), astroid.nodes.ClassDef)
        and node.name == "__init__"
    )
def is_constructor ( node ) : return ( node . parent and isinstance ( node . parent . scope ( ) , astroid . nodes . ClassDef ) and node . name == "__init__" )