Utilities for run-time type validation and multiple dispatch
MIT License
Published by erezsh 10 months ago
Full Changelog: https://github.com/erezsh/runtype/compare/0.4.1...0.4.2
Published by erezsh 10 months ago
Full Changelog: https://github.com/erezsh/runtype/compare/0.4.0...0.4.1
Published by erezsh about 1 year ago
Changes summary:
typing
and types
modules, and for generics.multidispatch
singleton decorator, and multidispatch_final
Full Changelog: https://github.com/erezsh/runtype/compare/0.3.5...0.4.0
Published by erezsh over 1 year ago
__init__
, adding to builtin implementation instead of overriding it by @erezsh in https://github.com/erezsh/runtype/pull/32
Full Changelog: https://github.com/erezsh/runtype/compare/0.3.2...0.3.5
Published by erezsh over 1 year ago
Full Changelog: https://github.com/erezsh/runtype/compare/0.3.0...0.3.2
Published by erezsh about 2 years ago
Full Changelog: https://github.com/erezsh/runtype/compare/0.2.7...0.3.0
Published by erezsh over 2 years ago
To use the mypy plugin, create mypy.ini
with the following contents:
[mypy]
plugins = runtype.mypy
Published by erezsh over 2 years ago
Published by erezsh over 2 years ago
Full Changelog: https://github.com/erezsh/runtype/compare/0.2.4...0.2.5
Published by erezsh about 3 years ago
cast_from
on user classesFull Changelog: https://github.com/erezsh/runtype/compare/0.2.3...0.2.4
Published by erezsh about 3 years ago
Published by erezsh about 3 years ago
Various fixes
Added check_types='sample'
Rewrote isa
to use our own PythonType hierarchy instead of Python's typing classes, for a huge performance boost
Added support for Literal, Mapping, collections.abc, set, frozenset
Added support for assigning default mutables (e.g. a: list = []
)
Added auto-casting support, with dataclass(check_types='cast')
- str -> datetime
- str -> int
- int -> float
Added support for value constraints
- Int(min, max)
- String(min_length)
Added support for auto Optional by defaulting to None
Refactored ensure_isa -> Configuration
Added support for required keyword (i.e. without a default value, after defaults are already specified)
Various bugfixes