A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mkdocstrings.github.io/griffe/reference/api/expressions/ below:

Expressions - Griffe

Expressions¤ Helpers¤ get_annotation module-attribute ¤ get_base_class module-attribute ¤ get_condition module-attribute ¤ get_expression ¤

Build an expression from an AST.

Parameters:

Returns:

safe_get_annotation module-attribute ¤ safe_get_base_class module-attribute ¤ safe_get_condition module-attribute ¤ safe_get_expression ¤

Safely (no exception) build a resolvable annotation.

Parameters:

Returns:

Expression nodes¤ Expr dataclass ¤

Base class for expressions.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprAttribute dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprAttribute[ExprAttribute]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprAttribute
                


              click griffe.ExprAttribute href "" "griffe.ExprAttribute"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Attributes like a.b.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

The canonical path of this attribute.

classname property ¤

The expression class name.

first property ¤

The first part of this attribute (on the left).

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

last property ¤

The last part of this attribute (on the right).

path property ¤

The path of this attribute.

values instance-attribute ¤

The different parts of the dotted chain.

__iter__ ¤

Iterate on the expression syntax and elements.

append ¤

Append a name to this attribute.

Parameters:

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprBinOp dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprBinOp[ExprBinOp]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprBinOp
                


              click griffe.ExprBinOp href "" "griffe.ExprBinOp"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Binary operations like a + b.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

left instance-attribute ¤

Left part.

operator instance-attribute ¤

Binary operator.

path property ¤

Path of the expressed name/attribute.

right instance-attribute ¤

Right part.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprBoolOp dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprBoolOp[ExprBoolOp]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprBoolOp
                


              click griffe.ExprBoolOp href "" "griffe.ExprBoolOp"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Boolean operations like a or b.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

operator instance-attribute ¤

Boolean operator.

path property ¤

Path of the expressed name/attribute.

values instance-attribute ¤

Operands.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprCall dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprCall[ExprCall]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprCall
                


              click griffe.ExprCall href "" "griffe.ExprCall"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Calls like f().

Methods:

Attributes:

arguments instance-attribute ¤

Passed arguments.

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

The canonical path of this subscript's left part.

classname property ¤

The expression class name.

function instance-attribute ¤

Function called.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprCompare dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprCompare[ExprCompare]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprCompare
                


              click griffe.ExprCompare href "" "griffe.ExprCompare"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Comparisons like a > b.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

comparators instance-attribute ¤

Things compared.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

left instance-attribute ¤

Left part.

operators instance-attribute ¤

Comparison operators.

path property ¤

Path of the expressed name/attribute.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprComprehension dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprComprehension[ExprComprehension]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprComprehension
                


              click griffe.ExprComprehension href "" "griffe.ExprComprehension"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Comprehensions like a for b in c if d.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

conditions instance-attribute ¤

Conditions to include the target in the result.

is_async class-attribute instance-attribute ¤

Async comprehension or not.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

iterable instance-attribute ¤

Value iterated on.

path property ¤

Path of the expressed name/attribute.

target instance-attribute ¤

Comprehension target (value added to the result).

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprConstant dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprConstant[ExprConstant]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprConstant
                


              click griffe.ExprConstant href "" "griffe.ExprConstant"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Constants like "a" or 1.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

value instance-attribute ¤

Constant value.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprDict dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprDict[ExprDict]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprDict
                


              click griffe.ExprDict href "" "griffe.ExprDict"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Dictionaries like {"a": 0}.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

keys instance-attribute ¤

Dict keys.

path property ¤

Path of the expressed name/attribute.

values instance-attribute ¤

Dict values.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprDictComp dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprDictComp[ExprDictComp]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprDictComp
                


              click griffe.ExprDictComp href "" "griffe.ExprDictComp"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Dict comprehensions like {k: v for k, v in a}.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

generators instance-attribute ¤

Generators iterated on.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

key instance-attribute ¤

Target key.

path property ¤

Path of the expressed name/attribute.

value instance-attribute ¤

Target value.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprExtSlice dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprExtSlice[ExprExtSlice]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprExtSlice
                


              click griffe.ExprExtSlice href "" "griffe.ExprExtSlice"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Extended slice like a[x:y, z].

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

dims instance-attribute ¤

Dims.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprFormatted dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprFormatted[ExprFormatted]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprFormatted
                


              click griffe.ExprFormatted href "" "griffe.ExprFormatted"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Formatted string like {1 + 1}.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

value instance-attribute ¤

Formatted value.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprGeneratorExp dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprGeneratorExp[ExprGeneratorExp]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprGeneratorExp
                


              click griffe.ExprGeneratorExp href "" "griffe.ExprGeneratorExp"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Generator expressions like a for b in c for d in e.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

element instance-attribute ¤

Yielded element.

generators instance-attribute ¤

Generators iterated on.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprIfExp dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprIfExp[ExprIfExp]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprIfExp
                


              click griffe.ExprIfExp href "" "griffe.ExprIfExp"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Conditions like a if b else c.

Methods:

Attributes:

body instance-attribute ¤

Value if test.

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

orelse instance-attribute ¤

Other expression.

path property ¤

Path of the expressed name/attribute.

test instance-attribute ¤

Condition.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprJoinedStr dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprJoinedStr[ExprJoinedStr]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprJoinedStr
                


              click griffe.ExprJoinedStr href "" "griffe.ExprJoinedStr"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Joined strings like f"a {b} c".

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

values instance-attribute ¤

Joined values.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprKeyword dataclass ¤
ExprKeyword(
    name: str,
    value: str | Expr,
    function: Expr | None = None,
)

Bases: Expr


              flowchart TD
              griffe.ExprKeyword[ExprKeyword]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprKeyword
                


              click griffe.ExprKeyword href "" "griffe.ExprKeyword"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Keyword arguments like a=b.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed keyword.

classname property ¤

The expression class name.

function class-attribute instance-attribute ¤
function: Expr | None = None

Expression referencing the function called with this parameter.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

name instance-attribute ¤

Name.

path property ¤

Path of the expressed name/attribute.

value instance-attribute ¤

Value.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprVarPositional dataclass ¤
ExprVarPositional(value: Expr)

Bases: Expr


              flowchart TD
              griffe.ExprVarPositional[ExprVarPositional]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprVarPositional
                


              click griffe.ExprVarPositional href "" "griffe.ExprVarPositional"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Variadic positional parameters like *args.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

value instance-attribute ¤

Starred value.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprVarKeyword dataclass ¤
ExprVarKeyword(value: Expr)

Bases: Expr


              flowchart TD
              griffe.ExprVarKeyword[ExprVarKeyword]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprVarKeyword
                


              click griffe.ExprVarKeyword href "" "griffe.ExprVarKeyword"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Variadic keyword parameters like **kwargs.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

value instance-attribute ¤

Double-starred value.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprLambda dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprLambda[ExprLambda]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprLambda
                


              click griffe.ExprLambda href "" "griffe.ExprLambda"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Lambda expressions like lambda a: a.b.

Methods:

Attributes:

body instance-attribute ¤

Lambda's body.

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

parameters instance-attribute ¤

Lambda's parameters.

path property ¤

Path of the expressed name/attribute.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprList dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprList[ExprList]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprList
                


              click griffe.ExprList href "" "griffe.ExprList"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Lists like [0, 1, 2].

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

elements instance-attribute ¤

List elements.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprListComp dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprListComp[ExprListComp]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprListComp
                


              click griffe.ExprListComp href "" "griffe.ExprListComp"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

List comprehensions like [a for b in c].

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

element instance-attribute ¤

Target value.

generators instance-attribute ¤

Generators iterated on.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprName dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprName[ExprName]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprName
                


              click griffe.ExprName href "" "griffe.ExprName"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

This class represents a Python object identified by a name in a given scope.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

The canonical name (resolved one, not alias name).

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_enum_class property ¤

Whether this name resolves to an enumeration class.

is_enum_instance property ¤

Whether this name resolves to an enumeration instance.

is_enum_value property ¤

Whether this name resolves to an enumeration value.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

is_type_parameter property ¤

Whether this name resolves to a type parameter.

member class-attribute instance-attribute ¤
member: str | None = None

Member name (for resolution in its scope).

name instance-attribute ¤

Actual name.

parent class-attribute instance-attribute ¤

Parent (for resolution in its scope).

path property ¤

The full, resolved name.

If it was given when creating the name, return that. If a callable was given, call it and return its result. It the name cannot be resolved, return the source.

resolved property ¤

The resolved object this name refers to.

__eq__ ¤

Two name expressions are equal if they have the same name value (parent is ignored).

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprNamedExpr dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprNamedExpr[ExprNamedExpr]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprNamedExpr
                


              click griffe.ExprNamedExpr href "" "griffe.ExprNamedExpr"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Named/assignment expressions like a := b.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

target instance-attribute ¤

Target name.

value instance-attribute ¤

Value.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprParameter dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprParameter[ExprParameter]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprParameter
                


              click griffe.ExprParameter href "" "griffe.ExprParameter"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Parameters in function signatures like a: int = 0.

Methods:

Attributes:

annotation class-attribute instance-attribute ¤
annotation: Expr | None = None

Parameter type.

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

default class-attribute instance-attribute ¤

Parameter default.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

kind class-attribute instance-attribute ¤

Parameter kind.

name instance-attribute ¤

Parameter name.

path property ¤

Path of the expressed name/attribute.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprSet dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprSet[ExprSet]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprSet
                


              click griffe.ExprSet href "" "griffe.ExprSet"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Sets like {0, 1, 2}.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

elements instance-attribute ¤

Set elements.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprSetComp dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprSetComp[ExprSetComp]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprSetComp
                


              click griffe.ExprSetComp href "" "griffe.ExprSetComp"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Set comprehensions like {a for b in c}.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

element instance-attribute ¤

Target value.

generators instance-attribute ¤

Generators iterated on.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprSlice dataclass ¤
ExprSlice(
    lower: str | Expr | None = None,
    upper: str | Expr | None = None,
    step: str | Expr | None = None,
)

Bases: Expr


              flowchart TD
              griffe.ExprSlice[ExprSlice]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprSlice
                


              click griffe.ExprSlice href "" "griffe.ExprSlice"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Slices like [a:b:c].

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

lower class-attribute instance-attribute ¤

Lower bound.

path property ¤

Path of the expressed name/attribute.

step class-attribute instance-attribute ¤

Iteration step.

upper class-attribute instance-attribute ¤

Upper bound.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprSubscript dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprSubscript[ExprSubscript]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprSubscript
                


              click griffe.ExprSubscript href "" "griffe.ExprSubscript"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Subscripts like a[b].

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

The canonical path of this subscript's left part.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

left instance-attribute ¤

Left part.

path property ¤

The path of this subscript's left part.

slice instance-attribute ¤

Slice part.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprTuple dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprTuple[ExprTuple]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprTuple
                


              click griffe.ExprTuple href "" "griffe.ExprTuple"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Tuples like (0, 1, 2).

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

elements instance-attribute ¤

Tuple elements.

implicit class-attribute instance-attribute ¤

Whether the tuple is implicit (e.g. without parentheses in a subscript's slice).

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprUnaryOp dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprUnaryOp[ExprUnaryOp]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprUnaryOp
                


              click griffe.ExprUnaryOp href "" "griffe.ExprUnaryOp"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Unary operations like -1.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

operator instance-attribute ¤

Unary operator.

path property ¤

Path of the expressed name/attribute.

value instance-attribute ¤

Value.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprYield dataclass ¤
ExprYield(value: str | Expr | None = None)

Bases: Expr


              flowchart TD
              griffe.ExprYield[ExprYield]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprYield
                


              click griffe.ExprYield href "" "griffe.ExprYield"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Yield statements like yield a.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

value class-attribute instance-attribute ¤

Yielded value.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

ExprYieldFrom dataclass ¤

Bases: Expr


              flowchart TD
              griffe.ExprYieldFrom[ExprYieldFrom]
              griffe._internal.expressions.Expr[Expr]

                              griffe._internal.expressions.Expr --> griffe.ExprYieldFrom
                


              click griffe.ExprYieldFrom href "" "griffe.ExprYieldFrom"
              click griffe._internal.expressions.Expr href "" "griffe._internal.expressions.Expr"
            

Yield statements like yield from a.

Methods:

Attributes:

canonical_name property ¤

Name of the expressed name/attribute/parameter.

canonical_path property ¤

Path of the expressed name/attribute.

classname property ¤

The expression class name.

is_classvar property ¤

Whether this attribute is annotated with ClassVar.

is_generator property ¤

Whether this expression is a generator.

is_iterator property ¤

Whether this expression is an iterator.

is_tuple property ¤

Whether this expression is a tuple.

path property ¤

Path of the expressed name/attribute.

value instance-attribute ¤

Yielded-from value.

__iter__ ¤

Iterate on the expression syntax and elements.

as_dict ¤

Return the expression as a dictionary.

Parameters:

Returns:

iterate ¤

Iterate on the expression elements.

Parameters:

Yields:

modernize ¤

Modernize the expression.

For example, use PEP 604 type unions | instead of typing.Union.

Returns:

2025-08-11 2024-07-10

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4