Skip to content

Config

This is the object used for PolyModel configuration options and only contains a very little amount of paramenters.

How to import

Very easy to import.

from polyforce import Config

How to use

The Config object is used inside objects that inherit from PolyModel.

from polyforce import Config, PolyModel


class Movie(PolyModel):
    config: Config = Config(ignore=..., ignored_types=...)
    ...

The same parameters of the config are also present in polycheck decorator as well.

from polyforce import polycheck


@polycheck(ignore=..., ignored_types=...)
def my_function() -> None:
    ...

Parameters

  • ignore - Flag indicating if the static type checking should be ignored. When this is applied on a PolyModel level, it will disable the checks for the whole class, whereas when applied on a polycheck level, it will only disable for the function where the decorator is being applied.

    Default: False

  • ignored_types - List or tuple of python types, any type that should be ignored from the static type checking. When a type is passed to ignored_types=(...,), the attribute with declared with the type being ignored will be assumed as Any.

    Default: ()