Skip to content

ParameterAssignment

Bases: Enum

How arguments are assigned to parameters. The parameters must appear exactly in this order in a parameter list.

IMPLICIT parameters appear on instance methods (usually called "self") and on class methods (usually called "cls"). POSITION_ONLY parameters precede the "/" in a parameter list. NAME_ONLY parameters follow the "" or the POSITIONAL_VARARGS parameter ("args"). Between the "/" and the "" the POSITION_OR_NAME parameters reside. Finally, the parameter list might optionally include a NAMED_VARARG parameter ("*kwargs").

Source code in library_analyzer/processing/api/model/_parameters.py
class ParameterAssignment(Enum):
    """
    How arguments are assigned to parameters. The parameters must appear exactly in this order in a parameter list.

    IMPLICIT parameters appear on instance methods (usually called "self") and on class methods (usually called "cls").
    POSITION_ONLY parameters precede the "/" in a parameter list. NAME_ONLY parameters follow the "*" or the
    POSITIONAL_VARARGS parameter ("*args"). Between the "/" and the "*" the POSITION_OR_NAME parameters reside. Finally,
    the parameter list might optionally include a NAMED_VARARG parameter ("**kwargs").
    """

    IMPLICIT = "IMPLICIT"
    POSITION_ONLY = "POSITION_ONLY"
    POSITION_OR_NAME = "POSITION_OR_NAME"
    POSITIONAL_VARARG = ("POSITIONAL_VARARG",)
    NAME_ONLY = "NAME_ONLY"
    NAMED_VARARG = "NAMED_VARARG"

IMPLICIT = 'IMPLICIT' class-attribute

NAMED_VARARG = 'NAMED_VARARG' class-attribute

NAME_ONLY = 'NAME_ONLY' class-attribute

POSITIONAL_VARARG = ('POSITIONAL_VARARG') class-attribute

POSITION_ONLY = 'POSITION_ONLY' class-attribute

POSITION_OR_NAME = 'POSITION_OR_NAME' class-attribute