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

Function is_complex_number

crates/ruff_python_parser/src/parser/pattern.rs:831–839  ·  view source on GitHub ↗

Returns `true` if the given expression is a complex number literal.

(expr: &Expr)

Source from the content-addressed store, hash-verified

829
830/// Returns `true` if the given expression is a complex number literal.
831const fn is_complex_number(expr: &Expr) -> bool {
832 matches!(
833 expr,
834 Expr::NumberLiteral(ast::ExprNumberLiteral {
835 value: ast::Number::Complex { .. },
836 ..
837 })
838 )
839}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected