Types

Type aliases.

Warning

This module is provisional. Types may be modified, added, and removed between minor releases.

marshmallow.types.ErrorMessageValue: TypeAlias = str | list | dict

Type for a single error message value, which can be a string, list, or dict

marshmallow.types.ErrorMessages(*args, **kwargs)

Type for error_messages dictionaries passed to fields

alias of dict[str, str | list | dict]

marshmallow.types.PostLoadCallable(*args, **kwargs)

Type for field-level post-load functions

alias of Callable[[T], T]

marshmallow.types.PreLoadCallable(*args, **kwargs)

Type for field-level pre-load functions

alias of Callable[[Any], Any]

class marshmallow.types.RenderModule(*args, **kwargs)[source]
class marshmallow.types.SchemaValidator(*args, **kwargs)[source]
marshmallow.types.StrSequenceOrSet(*args, **kwargs)

A type that can be either a sequence of strings or a set of strings

alias of Sequence[str] | AbstractSet[str]

marshmallow.types.UnknownOption(*args, **kwargs)

A valid option for the unknown schema option and argument

alias of Literal[‘exclude’, ‘include’, ‘raise’]

marshmallow.types.Validator(*args, **kwargs)

Type for validator functions

alias of Callable[[Any], Any]