pytools.expression.composite.Call#

class pytools.expression.composite.Call(callee, *args, **kwargs)[source]#

A call expression.

Bases

Invocation

Metaclasses

ABCMeta

Parameters
  • callee (Any) – the expression representing the object being called

  • args (Any) – the positional argument(s) of the call

  • kwargs (Any) – the keyword arguments of the call

Method summary

and_

Create a logical and expression using this and another expression as operands.

eq_

Compare this expression with another for equality.

hash_

Calculate the hash code for this expression.

not_

Create a logical not expression using this expression as the operand.

or_

Create a logical or expression using this and another expression as operands.

to_expression

Render this object as an expression.

Attribute summary

body_

The expression representing the arguments enclosed by brackets.

callee_

The expression being called; identical with the prefix of this expression.

precedence_

The precedence of this expression, used to determine the need for parentheses.

prefix_

The prefix of this expression.

separator_

One or more characters separating the prefix and the subexpression.

subexpressions_

A tuple containing the prefix and the body of this expression.

Definitions

__call__(*args, **kwargs)#

Generate a Call expression.

Return type

Expression

Returns

the resulting expression

and_(other)#

Create a logical and expression using this and another expression as operands.

Parameters

other (Expression) – other operand to combine with this expression using a logical and

Return type

Expression

Returns

the logical and expression

eq_(other)#

Compare this expression with another for equality.

For using Python’s native equality operator ==, see FrozenExpression.

Parameters

other (Expression) – the expression to compare this expression with

Return type

bool

Returns

True if both expressions are equal; False otherwise

hash_()#

Calculate the hash code for this expression.

For using Python’s native hash function, see FrozenExpression.

Return type

int

Returns

the hash code for this expression

not_()#

Create a logical not expression using this expression as the operand.

Return type

Expression

Returns

the logical not expression

or_(other)#

Create a logical or expression using this and another expression as operands.

Parameters

other (Expression) – other operand to combine with this expression using a logical or

Return type

Expression

Returns

the logical or expression

to_expression()#

Render this object as an expression.

Return type

Expression

Returns

the expression representing this object

property body_: pytools.expression.base.CollectionLiteral#

The expression representing the arguments enclosed by brackets.

Return type

CollectionLiteral

property callee_: pytools.expression.Expression#

The expression being called; identical with the prefix of this expression.

Return type

Expression

property precedence_: int#

The precedence of this expression, used to determine the need for parentheses.

Return type

int

property prefix_: pytools.expression.Expression#

The prefix of this expression.

Return type

Expression

property separator_: str#

One or more characters separating the prefix and the subexpression.

Return type

str

property subexpressions_: tuple[pytools.expression.Expression, ...]#

A tuple containing the prefix and the body of this expression.

Return type

tuple[Expression, ...]