Optype

Latest version: v0.8.0

Safety actively analyzes 693883 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

0.6.0

Highlights

- [Mypy](https://github.com/python/mypy) support (strict mode)
- [Beartype](https://github.com/beartype/beartype) support
- New standard library modules
- [`optype.copy`](optypecopy)
- [`optype.dataclasses`](optypedataclasses)
- [`optype.inspect`](optypeinspect)
- [`optype.json`](optypejson)
- [`optype.pickle`](optypepickle)
- [`optype.string`](optypestring)
- [`optype.typing`](optypetyping)
- Improvements to [`optype.numpy`](optypenumpy) (it's still optional)
- [NumPy 2.1](https://github.com/numpy/numpy) support
- Improved docs
- [Shape type aliases`](shape-type-aliases)
- Support for `numpy.dtypes.StringDType` (`numpy >= 2`)
- Reworked [`Any*Array` and `Any*DType`](anyarray-and-anydtype)


Breaking changes

- Increased the minimum Python version from 3.10.0 to 3.10.1
- Increased the minimum `typing_extensions` version from 4.7 to 4.8
- Moved `CanCopy`, `CanDeepcopy` and `CanReplace` from `optype._` to [`optype.copy._`](optypecopy)
- Moved `HasDataclassFields` from `optype._` to [`optype.dataclasses._`](optypedataclasses)
- Moved `CanGetnewargs[Ex]`, `CanReduce[Ex]`, and `Can{Get,Set}state` from `optype._` to [`optype.pickle._`](optypepickle)
- [`Any*Array` and `Any*DType`](anyarray-and-anydtype) for `int_`, `float64` and `complex128` don't include `int`, `float`, and `complex` anymore. See https://github.com/numpy/numpy/issues/27032#issuecomment-2249308801 for why this was done.


**Full Changelog**: https://github.com/jorenham/optype/compare/v0.5.0...v0.6.0

0.5.0

Release highlights

- `optype.numpy`: (optional) NumPy (1 & 2) typing protocols and aliases, see the [docs](https://github.com/jorenham/optype?tab=readme-ov-file#numpy) the details
- Implement [PEP 696](https://peps.python.org/pep-0696/) type parameter defaults
- `*Self` aliases for the context manager `Can*` interfaces
- `*Self` aliases for the inplace operand `CanI*` interfaces
- Many documentation fixes & improvements
- Simplified local development using Tox

Breaking changes

- `typing_extensions` is now required for all Python versions <3.13

What's Changed
* bump basedpyright to 1.10.2 by jorenham in https://github.com/jorenham/optype/pull/49
* bump ruff to 0.4.0 by jorenham in https://github.com/jorenham/optype/pull/50
* bump basedpyright to 1.10.3 by jorenham in https://github.com/jorenham/optype/pull/51
* bump ruff to 0.4.1 by jorenham in https://github.com/jorenham/optype/pull/52
* use `repo-review` and `tox` by jorenham in https://github.com/jorenham/optype/pull/53
* Fix example code formatting issues in README.md by jorenham in https://github.com/jorenham/optype/pull/54
* Bump ruff from 0.4.1 to 0.4.2 by dependabot in https://github.com/jorenham/optype/pull/56
* Bump basedpyright from 1.10.3 to 1.10.4 by dependabot in https://github.com/jorenham/optype/pull/57
* Bump sp-repo-review from 2024.3.10 to 2024.4.23 by dependabot in https://github.com/jorenham/optype/pull/58
* Bump pytest from 8.1.1 to 8.2.0 by dependabot in https://github.com/jorenham/optype/pull/59
* Bump tox from 4.14.2 to 4.15.0 by dependabot in https://github.com/jorenham/optype/pull/60
* Update development dependencies by jorenham in https://github.com/jorenham/optype/pull/77
* Bump basedpyright to 1.12.6 by jorenham in https://github.com/jorenham/optype/pull/79
* Improved pre-commit & markdownlint config by jorenham in https://github.com/jorenham/optype/pull/80
* Use pre-commit within tox by jorenham in https://github.com/jorenham/optype/pull/81
* Bump scientific-python/repo-review from 0.10.6 to 0.11.0 by dependabot in https://github.com/jorenham/optype/pull/63
* Defaults for generic type parameters by jorenham in https://github.com/jorenham/optype/pull/78
* Add `*Self` aliases for the augmented binop `CanI*` interfaces by jorenham in https://github.com/jorenham/optype/pull/82
* Add missing overloads to `DoesI*` inplace binary operator callable protocols by jorenham in https://github.com/jorenham/optype/pull/83
* Bump ruff to 0.4.9 by jorenham in https://github.com/jorenham/optype/pull/84
* `*Self` aliases for the unary arithmetic operand interfaces by jorenham in https://github.com/jorenham/optype/pull/85
* add `*Self` aliases for context manager interfaces by jorenham in https://github.com/jorenham/optype/pull/86
* Prefer `typing_extensions` imports for `Protocol` and `runtime_checkable` by jorenham in https://github.com/jorenham/optype/pull/87
* Test using beartype by jorenham in https://github.com/jorenham/optype/pull/88
* bump basedpyright to 1.13.0 by jorenham in https://github.com/jorenham/optype/pull/91
* `optype.numpy`: interfaces and type-aliases for numpy by jorenham in https://github.com/jorenham/optype/pull/55
* Use the new basedpyright pre-commit hook by jorenham in https://github.com/jorenham/optype/pull/92
* Bump ruff to 0.4.10 by jorenham in https://github.com/jorenham/optype/pull/93
* Add the `optype.inspect` module by jorenham in https://github.com/jorenham/optype/pull/94


**Full Changelog**: https://github.com/jorenham/optype/compare/v0.4.0...v0.5.0

0.4.0

The minimum required Python version has been lowered from 3.12 to 3.10.

What's Changed
* Bump `basedpyright` to 1.10.0 by jorenham in https://github.com/jorenham/optype/pull/41
* basedpyright badge by jorenham in https://github.com/jorenham/optype/pull/42
* bump ruff to 0.3.7 and basedpyright to 1.10.1 by jorenham in https://github.com/jorenham/optype/pull/43
* Add pypi classifiers and project urls by jorenham in https://github.com/jorenham/optype/pull/44
* Add `CONTRIBUTING.md` and `CODE_OF_CONDUCT.md` by jorenham in https://github.com/jorenham/optype/pull/45
* Run markdownlint in the CI workflow by jorenham in https://github.com/jorenham/optype/pull/46
* Support for Python 3.11 and 3.13 by jorenham in https://github.com/jorenham/optype/pull/47
* Support for Python 3.10 by jorenham in https://github.com/jorenham/optype/pull/48


**Full Changelog**: https://github.com/jorenham/optype/compare/v0.3.1...v0.4.0

0.3.1

What's Changed
* Update pyright and pre-commit by jorenham in https://github.com/jorenham/optype/pull/34
* Switch from pyright to basedpyright by jorenham in https://github.com/jorenham/optype/pull/35
* Introductory usage example by jorenham in https://github.com/jorenham/optype/pull/38
* Bump ruff from 0.3.4 to 0.3.5 by dependabot in https://github.com/jorenham/optype/pull/37
* Post ruff upgrade tweaks by jorenham in https://github.com/jorenham/optype/pull/39


**Full Changelog**: https://github.com/jorenham/optype/compare/v0.3.0...v0.3.1

0.3.0

What's Changed
* Fix `CanAIterSelf` not being an `AsyncGenerator` subtype by jorenham in https://github.com/jorenham/optype/pull/17
* upgrade pyright to 1.1.355 by jorenham in https://github.com/jorenham/optype/pull/18
* several doc fixes and improvements by jorenham in https://github.com/jorenham/optype/pull/27
* add ops for `__reversed__` and `__missing__` by jorenham in https://github.com/jorenham/optype/pull/28
- `CanSequence[I: CanIndex, V]` (combines `CanLen` and `CanGetitem[I, V]`)
- `do_reversed: DoesReversed` (type-corrected alias for `builtins.reversed`)
- `do_missing: DoesMissing` (calls `.__missing__()`)
* Interfaces for the `copy` standard library by jorenham in https://github.com/jorenham/optype/pull/29
- `CanCopy[T]` and `CanCopySelf`
- `CanDeepcopy[T]` and `CanDeepcopySelf`
- `CanReplace[T, V]` and `CanReplaceSelf[V]`
* Interfaces for the `pickle` standard library by jorenham in https://github.com/jorenham/optype/pull/30
- `CanReduce[R: str | tuple]`
- `CanReduceEx[R: str | tuple]`
- `CanGetState[S]`
- `CanSetState[S]`
- `CanGetnewargs[*Args]`
- `CanGetnewargsEx[*Args, Kw]`
* upgrade to ruff 0.3.4 by jorenham in https://github.com/jorenham/optype/pull/31
* Interfaces for the `dataclasses` standard library by jorenham in https://github.com/jorenham/optype/pull/32
- `HasDataclassFields`


**Full Changelog**: https://github.com/jorenham/optype/compare/v0.2.2...v0.3.0

0.2.2

What's Changed
* fix incorrect `optype.do_ne` annotation by jorenham in https://github.com/jorenham/optype/pull/10
* fix incorrect `optype.DoesIMod` annotation by jorenham in https://github.com/jorenham/optype/pull/11
* upgrade to ruff 0.3.3 by jorenham in https://github.com/jorenham/optype/pull/12
* add docstrings for some `Can*` types by jorenham in https://github.com/jorenham/optype/pull/13
* add `CanIterSelf[+V]` and `CanAIterSelf[+V]` by jorenham in https://github.com/jorenham/optype/pull/14
* add typed ops for `__len__` and `__length_hint__` by jorenham in https://github.com/jorenham/optype/pull/15


**Full Changelog**: https://github.com/jorenham/optype/compare/v0.2.1...v0.2.2

Page 2 of 3

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.