runtype

Utilities for run-time type validation and multiple dispatch

MIT License

Downloads
22K
Stars
159
Committers
2
runtype - 0.4.2 - Small fixes for typesystem & pytypes Latest Release

Published by erezsh 10 months ago

What's Changed

Full Changelog: https://github.com/erezsh/runtype/compare/0.4.1...0.4.2

runtype - 0.4.1 - Small fix for tuples type checking

Published by erezsh 10 months ago

What's Changed

Full Changelog: https://github.com/erezsh/runtype/compare/0.4.0...0.4.1

runtype - 0.4.0 - Various improvements

Published by erezsh about 1 year ago

Changes summary:

  • Better support for typing and types modules, and for generics.
  • Added the multidispatch singleton decorator, and multidispatch_final
  • Better support for Mypy
  • Improved performance
  • Deprecated iter(dataclass_instance), which was a confusing behavior

What's Changed

Full Changelog: https://github.com/erezsh/runtype/compare/0.3.5...0.4.0

runtype - 0.3.5 - Bugfixes; Support for dispatch on dataclass __init__

Published by erezsh over 1 year ago

What's Changed

Full Changelog: https://github.com/erezsh/runtype/compare/0.3.2...0.3.5

runtype - 0.3.2 - Bugfixes, support for Annotated, and more

Published by erezsh over 1 year ago

What's Changed

Full Changelog: https://github.com/erezsh/runtype/compare/0.3.0...0.3.2

runtype - 0.3.0 - Support for forward-references; use Dispatch() in `with`

Published by erezsh about 2 years ago

What's Changed

Full Changelog: https://github.com/erezsh/runtype/compare/0.2.7...0.3.0

runtype - 0.2.7 - Added mypy plugin; Fix for TupleType

Published by erezsh over 2 years ago

To use the mypy plugin, create mypy.ini with the following contents:

[mypy]
plugins = runtype.mypy
runtype - 0.2.6 - Small fix for 0.2.5

Published by erezsh over 2 years ago

runtype - 0.2.5 - Slots in dataclass, and a few fixes

Published by erezsh over 2 years ago

What's Changed

  • Added support for Sequence[]; partial support for Type[]
  • Bugfix: json() now recurses into builtin Python collections (list, dict, etc.; issue #7)
  • Dataclass: Added support for automatic slots using slots keyword by @erezsh in https://github.com/erezsh/runtype/pull/8
  • Better support for type normalization (e.g. set, frozenset)

Full Changelog: https://github.com/erezsh/runtype/compare/0.2.4...0.2.5

runtype - - Added the validate_func ; support for Tuple[t, ...]

Published by erezsh about 3 years ago

  • Added the validate_func decorator
  • Added support for Tuple[t, ...]
  • Added experimental support for custom casts, using cast_from on user classes

Full Changelog: https://github.com/erezsh/runtype/compare/0.2.3...0.2.4

runtype - Bugfix for use of `dataclasses.field`

Published by erezsh about 3 years ago

runtype - Runtype 0.2: Better, more configurable, and faster

Published by erezsh about 3 years ago

0.2.2

  • Various fixes

  • Added check_types='sample'

0.2.1

  • Fix for 0.2.0

0.2.0

  • 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