MCPcopy Index your code
hub / github.com/python/mypy / UnaryExpr

Class UnaryExpr

mypy/nodes.py:2610–2629  ·  view source on GitHub ↗

Unary operation

Source from the content-addressed store, hash-verified

2608
2609
2610class UnaryExpr(Expression):
2611 """Unary operation"""
2612
2613 __slots__ = ("op", "expr", "method_type")
2614
2615 __match_args__ = ("op", "expr")
2616
2617 op: str # TODO: Enum?
2618 expr: Expression
2619 # Inferred operator method type
2620 method_type: mypy.types.Type | None
2621
2622 def __init__(self, op: str, expr: Expression) -> None:
2623 super().__init__()
2624 self.op = op
2625 self.expr = expr
2626 self.method_type = None
2627
2628 def accept(self, visitor: ExpressionVisitor[T]) -> T:
2629 return visitor.visit_unary_expr(self)
2630
2631
2632class AssignmentExpr(Expression):

Callers 3

visit_UnaryOpMethod · 0.90
visit_unary_exprMethod · 0.90
read_expressionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…