Skip to content
New: Star-import, signal unraveling, Python 3.12 support, and more

# annotations module

Utilities for annotations.

## flatten_annotations function

    flatten_annotations(
        annotations,
        only_var_args=False,
        return_var_arg_maps=False
    )

Flatten annotations of variable arguments.

## get_annotations function

    get_annotations(
        *args,
        **kwargs
    )

Get annotations.

## has_annotatables function

    has_annotatables(
        func,
        target_cls=vectorbtpro.utils.annotations.Annotatable
    )

Check if a function has subclasses or instances of Annotatable in its signature.

## Annotatable class

    Annotatable()

Class that can be used in annotations.

Subclasses

- ChunkTaker
- Chunked
- MergeFunc
- NotChunked
- Param
- Sizer
- Takeable
- Union
- VarArgs
- VarKwargs

## MetaAnnotatable class

    MetaAnnotatable(
        *args,
        **kwargs
    )

Metaclass that can be used in annotations.

Superclasses

- `builtins.type`

## Union class

    Union(
        *annotations,
        resolved=False
    )

Class representing a union of one to multiple annotations.

Superclasses

- Annotatable

### annotations class variable

Annotations.

### resolve method

    Union.resolve()

Resolve the union.

### resolved class variable

Whether the instance is resolved.

## VarArgs class

    VarArgs(
        *args
    )

Class representing annotations for variable positional arguments.

Superclasses

- Annotatable

### args class variable

Tuple with annotations.

## VarKwargs class

    VarKwargs(
        **kwargs
    )

Class representing annotations for variable keyword arguments.

Superclasses

- Annotatable

### kwargs class variable

Dict with annotations.

#### Cookie consent

We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.

- Google Analytics
- GitHub

Manage settings