"""
This type stub file was generated by pyright.
"""

from typing import Self, TYPE_CHECKING
from graph_sitter._proxy import proxy_property
from graph_sitter.core.autocommit import reader
from graph_sitter.core.interfaces.editable import Editable
from graph_sitter.core.statements.attribute import Attribute
from graph_sitter.python.assignment import PyAssignment
from graph_sitter.python.statements.assignment_statement import PyAssignmentStatement
from graph_sitter.writer_decorators import noapidoc, py_apidoc
from graph_sitter.python.class_definition import PyClass

if TYPE_CHECKING:
    ...
@py_apidoc
class PyAttribute(Attribute["PyCodeBlock", "PyAssignment"], PyAssignmentStatement):
    """Python implementation of Attribute detached symbol."""
    @property
    @reader
    def is_private(self) -> bool:
        """Determines if this attribute is private by checking if its name starts with an underscore.

        Args:
            None

        Returns:
            bool: True if the attribute name starts with an underscore, False otherwise.
        """
        ...
    
    @proxy_property
    @reader
    def local_usages(self) -> list[Editable[Self]]:
        """Returns all instances where this attribute is used within its parent code block.

        Finds all references to this attribute that are prefixed with 'self.' within the code block, excluding the initial assignment.

        Note:
        This method can be called as both a property or a method. If used as a property, it is equivalent to invoking it without arguments.

        Returns:
            list[Editable[Self]]: A sorted list of unique attribute references. Each reference is an Editable object representing a usage of this attribute.
        """
        ...
    
    @property
    def is_optional(self) -> bool:
        """Check if the attribute is optional.

        Returns `True` if the attribute is marked as optional, `False` otherwise. Not applicable for Python and will raise an error.

        Returns:
            bool: Whether the attribute is optional.

        Raises:
            APINotApplicableForLanguageError: Always raised as Python does not have explicit optional attribute syntax.
        """
        ...
    
    @property
    @reader
    @noapidoc
    def attribute_docstring(self) -> str:
        """Definition of the attribute. Ex: `type: TType`"""
        ...
    
    @noapidoc
    @reader
    def docstring(self, base_class: PyClass) -> str | None:
        """Parse the docstring of the attribute from it's parent class docstrings."""
        ...
    


