MCPcopy Index your code
hub / github.com/ipython/ipython / _is_instance_attribute_assignment

Function _is_instance_attribute_assignment

IPython/core/guarded_eval.py:741–751  ·  view source on GitHub ↗

Return True if target is an attribute access on the instance argument.

(
    target: ast.AST, context: EvaluationContext
)

Source from the content-addressed store, hash-verified

739
740
741def _is_instance_attribute_assignment(
742 target: ast.AST, context: EvaluationContext
743) -> bool:
744 """Return True if target is an attribute access on the instance argument."""
745 return (
746 context.class_transients is not None
747 and context.instance_arg_name is not None
748 and isinstance(target, ast.Attribute)
749 and isinstance(getattr(target, "value", None), ast.Name)
750 and getattr(target.value, "id", None) == context.instance_arg_name
751 )
752
753
754def _get_coroutine_attributes() -> dict[str, Optional[object]]:

Callers 2

_handle_assignFunction · 0.85
_handle_annassignFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…