Skip to content

AttributeAssignment

Bases: Enum

How arguments are assigned to attributes. The attributes must appear exactly in this order in an attribute list.

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

Source code in src/library_analyzer/processing/api/model/_api.py
class AttributeAssignment(Enum):
    """
    How arguments are assigned to attributes. The attributes must appear exactly in this order in an attribute list.

    IMPLICIT attributes appear on instance methods (usually called "self") and on class methods (usually called "cls").
    POSITION_ONLY attributes precede the "/" in an attribute list. NAME_ONLY attributes follow the "*" or the
    POSITIONAL_VARARGS attribute ("*args"). Between the "/" and the "*" the POSITION_OR_NAME attributes reside. Finally,
    the attribute list might optionally include a NAMED_VARARG attribute ("**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 instance-attribute

NAMED_VARARG = 'NAMED_VARARG' class-attribute instance-attribute

NAME_ONLY = 'NAME_ONLY' class-attribute instance-attribute

POSITIONAL_VARARG = 'POSITIONAL_VARARG' class-attribute instance-attribute

POSITION_ONLY = 'POSITION_ONLY' class-attribute instance-attribute

POSITION_OR_NAME = 'POSITION_OR_NAME' class-attribute instance-attribute