MCPcopy Create free account
hub / github.com/astral-sh/ruff / statement

Method statement

crates/ruff_python_semantic/src/binding.rs:277–280  ·  view source on GitHub ↗

Returns the statement in which the binding was defined.

(&self, semantic: &SemanticModel<'b>)

Source from the content-addressed store, hash-verified

275
276 /// Returns the statement in which the binding was defined.
277 pub fn statement<'b>(&self, semantic: &SemanticModel<'b>) -> Option<&'b Stmt> {
278 self.source
279 .map(|statement_id| semantic.statement(statement_id))
280 }
281
282 /// Returns the expression in which the binding was defined
283 /// (e.g. for the binding `x` in `y = (x := 1)`, return the node representing `x := 1`).

Callers 1

parent_rangeMethod · 0.45

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected