NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #2222 most downloaded on PyPI
Building Blocks for Precise & Flexible Type Hints
Last release 2 days ago
02 Oct 2026
Release timing varies
gaps range from 9 days to 4 months
Nearly every release is documented
notes for 33 of 34 stable releases
3 versions withdrawn
withdrawn after publishing
3 years old
37 releases · first in 2024
…method descriptors, template strings, @deprecated , NumPy, and the Python 3.15 sentinel and frozendict
optype infer grew from a prototype into a much more complete type inference tool (docs):
--format compat output (backend="compat" in Python) that emits a type-checkable .pyi stub
$ optype infer --format compat "def f(x, y=1): return x + y"
from typing import Literal, overload
from optype import CanAdd, CanRAdd
@overload
def f[R, T = Literal[1]](x: CanAdd[T, R], y: T = 1) -> R: ...
@overload
def f[T, R](x: T, y: CanRAdd[T, R] = 1) -> R: ...*args and **kwargs, async functions, generators, context managers, overloads, class attributes, method descriptors, template strings, @deprecated, NumPy, and the Python 3.15 sentinel and frozendictstrict=True option that raises an InferError instead of emitting an InferWarning when the signature is incompleteoptype protocols: CanInstancecheck, CanSubclasscheck, CanRPow3, Can{Lt,Le,Gt,Ge}Same, and HasObjclass (docs)optype.numpy types: Array4D, MArray4D, CanArray4D, ToArray4D, and ToArrayStrict4D (docs)optypeHasObjclass protocol by @jorenham in #661CanInstancecheck and CanSubclasscheck by @jorenham in #662CanRPow3 by @jorenham in #757optype.Has* attribute protocols by @jorenham in #807Can{Lt,Le,Gt,Ge}Same by @jorenham in #810optype.numpyoptype infer: numpy support by @jorenham in #621numpy>=2.5 by @jorenham in #799optype.numpy.ctypeslib reference page by @Aniketsy in #581numpy: add Array4D and its 4-d siblings by @jorenham in #905optype.inferoptype infer: async support by @jorenham in #622optype infer: support for direct def (...): ... eval by @jorenham in #623optype infer: generators, and some code cleanup by @jorenham in #628optype infer: empty containers by @jorenham in #630optype infer: code cleanup and minor improvements by @jorenham in #631optype infer: simplify unions of subtypes by @jorenham in #632optype infer: support for *args and **kwargs by @jorenham in #633optype infer: parameter defaults by @jorenham in #634optype infer: avoid redundant & CanLen by @jorenham in #635optype infer: restructure modules by @jorenham in #636optype infer: method descriptors by @jorenham in #647infer: improved docs by @jorenham in #648infer: higher order function types by @jorenham in #652infer: CanWith and CanAsyncWith by @jorenham in #653infer: CanSequence by @jorenham in #654infer: Python 3.15 sentinel and frozendict support by @jorenham in #655infer: hide pos-only param names by @jorenham in #656infer: non-optypean protocols by @jorenham in #658infer: release changelog section for optype.infer by @jorenham in #659infer: class attributes by @jorenham in #660infer: Can{Instance,Subclass}check support and code cleanup by @jorenham in #664infer: KeyError on weakref.proxy by @jorenham in #673infer: invalid parameter names from docstring examples by @jorenham in #674infer: target exceptions escape instead of InferError by @jorenham in #676infer: recursive container types by @jorenham in #675infer: deterministic __len__, __int__, and __index__ branching by @jorenham in #681infer: non-deterministic literal rendering of concrete returns by @jorenham in #679infer: collapse repeated subexpressions by @jorenham in #680infer: variadic unpacking by @jorenham in #691infer: non-greedy overloaded signature exploration by @jorenham in #692infer: stable __bool__ and related branching truthiness dunders by @jorenham in #693infer: yield 2 items by default by @jorenham in #694infer: variadic callable parameter unpacking by @jorenham in #697infer: fix zip return type by @jorenham in #698infer: refactor by @jorenham in #699infer: EllipsisType by @jorenham in #702infer: unwrap GenericAlias and TypeForm support by @jorenham in #703infer: support all types types by @jorenham in #706infer: reraise exceptions by @jorenham in #707infer: @deprecated by @jorenham in #709infer: fix overly-narrow format string literals by @jorenham in #711infer: dedicated optype infer CLI docs by @jorenham in #712infer: strict mode by @jorenham in #713infer: presence-dispatch overloads by @jorenham in #714infer: code cleanup by @jorenham in #715infer: signature probing by @jorenham in #717infer: some refactoring by @jorenham in #718infer: stop using unions in isinstance by @jorenham in #719infer: fix second next and anext overloads by @jorenham in #720infer: 3-arg range inference by @jorenham in #725infer: generic slice builtin by @jorenham in #726infer: generic itertools types by @jorenham in #729infer: generic functools types by @jorenham in #730infer: better isinstance/issubclass inference by @jorenham in #732infer: catch KeyErrors by @jorenham in #740infer: fix non-termination by @jorenham in #743infer: unwrap TypeAliasType by @jorenham in #745infer: absorb empty container types by @jorenham in #746ignore: handle SystemExit by @jorenham in #747infer: fix __buffer__ GC issues by @jorenham in #748infer: render backend interface by @jorenham in #749infer: new .pyi-compatible rendering backend by @jorenham in #750infer: syntax highlighting for --format=compat by @jorenham in #752infer: template strings by @jorenham in #753infer: subprocess isolation by @jorenham in #754infer: fix outdated function -> FunctionType references by @jorenham in #755infer: signature simplification by @jorenham in #756infer: >2x faster inference by @jorenham in #758infer: refactor some by @jorenham in #759infer: improved performance (~2x faster) by @jorenham in #760infer: legacy CPython __text_signature__ support by @jorenham in #780infer: fix enum and *args rendering by @jorenham in #781infer: fix missing module prefixes and imports by @jorenham in #783infer: fix collections.Counter arity by @jorenham in #797infer: isolate all funciton calls and avoid phantom calls to spy __repr__ by @jorenham in #798infer: improved process isolation by @jorenham in #801infer: fix TypeError when inferring asyncio.run by @jorenham in #802infer: fix NameError when inspecting PEP 649 signatures by @jorenham in #803infer: fix internal _Spy signature render leaks by @jorenham in #805infer: code cleanup by @jorenham in #808infer: more code cleanup by @jorenham in #809infer: dealing with functions that block >1 minute by @jorenham in #814infer: refactor infer._gc as a singleton class by @jorenham in #815infer: less crappy docs by @jorenham in #816infer: improve code quality by @jorenham in #817infer: remove typing.cast calls by @jorenham in #818infer: code cleanup by @jorenham in #838infer: keep @deprecated on dispatch fallbacks and generators by @jorenham in #839infer: simplify renderer classes by @jorenham in #840infer: fix generic protocol bounds in compat by @jorenham in #842infer: elide non-finite float defaults by @jorenham in #852infer: keep a shared dependency out of the loop fold by @jorenham in #853infer: dedupe type nodes by equality by @jorenham in #847infer: fix attribute lowering in compat by @jorenham in #843infer: substitute eliminated binders in compat by @jorenham in #845infer: print positional-only __call__ defaults in compat by @jorenham in #846infer: order a typevar tuple behind defaulted type parameters in compat by @jorenham in #851infer: respect declared variance for all-Never arguments by @jorenham in #848infer: rename only type parameters in alpha_equal by @jorenham in #856infer: compare callable keywords and defaults in subtype by @jorenham in #850infer: join repeated protocol bases in compat by @jorenham in #854infer: name the arity forms of round and pow in compat by @jorenham in #861infer: decide typevar defaults up to typevar naming by @jorenham in #859infer: alias an import that a property name shadows in compat by @jorenham in #863infer: join protocol requirements before lowering them in compat by @jorenham in #862infer: overload __pow__ for two exponents in compat by @jorenham in #865infer: report a target-raised KeyboardInterrupt as an InferError by @jorenham in #867infer: detach the isolated child from the host's stdio by @jorenham in Note truncated.
One column per month.
Removed the deprecated optype.typing.Just* re-exports in favor of optype.Just* .
optype infer command for structural runtime type inference (docs)
$ optype infer "import math; math.sqrt"
(x: CanFloat | CanIndex) -> float
$ optype infer "lambda x: x * 2"
[R](x: CanMul[Literal[2], R]) -> R
$ optype infer "lambda x: -x + x"
[T: CanNeg[CanAdd[T, R]], R](x: T) -> R
[T, R](x: CanNeg[T] & CanRAdd[T, R]) -> Roptype.numpy.To* array-like types with beartype.optype.typing.Just* re-exports in favor of optype.Just*.optype.inferoptype.numpynumpy-typing-compat to v20260602 by @jorenham in #610numpy.To*: artisanal beartype support by @jorenham in #604optype.typinglefthook.yml -> .lefthook.yml by @jorenham in #615Full Changelog: v0.17.1...v0.18.0
This release addresses an issue in the CanRound and CanRound2 protocols.
This release addresses an issue in the CanRound and CanRound2 protocols.
optypefloat <: CanRound2[int, float] by @jorenham in #597do_round: (float, int) -> float by @jorenham in #598optype.numpy.ToJustInt64* by @jorenham in #580zensical --strict and fix errors by @jorenham in #589mypy_primer to avoid breaking downstream libraries by @Aniketsy in #583Full Changelog: v0.17.0...v0.17.1
Added a new optype.JustAny type that only accepts Any ( docs )
optype.JustAny type that only accepts Any (docs)optype.dataclasses.HasDataclassFields, and turn __dataclass_fields__ into a ClassVar. This fixes an assignability issue with dataclass instances.optypeoptype.dataclassesFull Changelog: v0.16.0...v0.17.0
documentation: https://jorenham.github.io/optype/
Dedicated documentation: https://jorenham.github.io/optype/
optype.test module (docs)optype.dataclasses.HasDataclassFields (docs) can now be used in issubclassImportError in optype.typing (docs) on Python 3.13+ when typing_extensions is not installedoptype.numpyoptype.dataclassesoptype.testoptype.typingty 0.0.6 and basedpyright 1.36.2 by @jorenham in #498uv_build to 0.10 by @jorenham in #523dprint config update workflow by @jorenham in #536.gitattributes for better handling of lockfile merge conflicts by @jorenham in #517typos==1.43.0 by @jorenham in #521Full Changelog: v0.15.0...v0.16.0
BREAKING: Certain optype.Can* generic type-parameters intended for literal types have been removed. This affects the following protocols:
BREAKING: Certain optype.Can* generic type-parameters intended for literal types have been removed. This affects the following protocols:
CanBytesCanStrCanIndexCanReprCanFormatCanDelattrCanLenCanLengthHintCanBufferCanGetattrCanSetattrCanSetNameCanContainsCanSequenceSee #487 for more information.
Preliminary support for the ty type-checker (currently in alpha) in #489.
Preliminary support for the upcoming NumPy 2.4 release.
uv_build to 0.9 by @jorenham in #469Full Changelog: v0.14.0...v0.15.0
Support for the Pyrefly type-checker
optype.copy.CanReplace protocoloptype.numpy.CanArray0 protocol that accepts both scalars and 0-d arraysoptype.numpy.ctypeslib improvementsoptype.numpyoptype.numpy.To* to use TypeAliasType by @jorenham in #444optype.numpy.ctypes: simplify Object and always use TypeAliasType by @jorenham in #446optype.numpy.ctypes: no complex C-types on windows by @jorenham in #447optype.numpy.ctypes tests by @jorenham in #449optype.numpy.ctypes: simplified abstract numeric aliases by @jorenham in #450optype.numpy.CanArray0 by @jorenham in #454optype.copycopy.CanReplace type parameter by @jorenham in #439copy.CanReplace docs by @jorenham in #441pyrefly to 0.35.0 by @jorenham in #453Full Changelog: v0.13.4...v0.14.0
upgrade numpy-typing-compat to v20250818 in the numpy extra by @jorenham in #421
This patch release adds an upper version bound for numpy-typing-compat to prevent potential compatibility issues with future releases.
This patch release adds an upper version bound for numpy-typing-compat to prevent potential compatibility issues with future releases.
optype.numpynumpy-typing-compat by @jorenham in #414numpy-typing-compat versioning by @jorenham in #418Full Changelog: v0.13.2...v0.13.3
This is a bugfix release that addresses a permission issue in the built wheels that was caused by astral-sh/uv#14920 .
This is a bugfix release that addresses a permission issue in the built wheels that was caused by astral-sh/uv#14920.
astral-sh/setup-uv to 6.5.0 by @jorenham in #413Full Changelog: v0.13.1...v0.13.2
fix CanArrayStrict{1,2,3}D by @jorenham in #407
<!-- Release notes generated using configuration in .github/release.yml at v0.13.0 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.13.0 -->
[!IMPORTANT] To ensure static typing compatibility with the SPEC 0 NumPy versions,
optype.numpynow requiresnumpy-typing-compat. It will automatically be installed with theoptype[numpy]extra.
optype.numpynumpy-typing-compat by @jorenham in https://github.com/jorenham/optype/pull/394AnyLongDouble* compatible with numpy<2.2 by @jorenham in https://github.com/jorenham/optype/pull/395Any[U]IntPDType compatible with numpy<2.2 by @jorenham in https://github.com/jorenham/optype/pull/396numpy-typing-compat by @jorenham in https://github.com/jorenham/optype/pull/399numpy==2.0.* in the testing matrix by @jorenham in https://github.com/jorenham/optype/pull/401np.ndarray instead of CanArray in To*Strict{1,2,3}D on numpy<2.1 by @jorenham in https://github.com/jorenham/optype/pull/400numpy-typing-compat / numpy version mismatch by @jorenham in https://github.com/jorenham/optype/pull/403numpy-typing-compat to v20250730 by @jorenham in https://github.com/jorenham/optype/pull/404numpy-typing-compat by @jorenham in https://github.com/jorenham/optype/pull/405Full Changelog: https://github.com/jorenham/optype/compare/v0.12.2...v0.13.0
<!-- Release notes generated using configuration in .github/release.yml at v0.12.2 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.12.2 -->
Full Changelog: https://github.com/jorenham/optype/compare/v0.12.1...v0.12.2
<!-- Release notes generated using configuration in .github/release.yml at v0.12.1 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.12.1 -->
optype.Can*Can*Same[-T?, +R?] with -> Self | R by @jorenham in https://github.com/jorenham/optype/pull/379CanI*Same inplace operator protocols by @jorenham in https://github.com/jorenham/optype/pull/381Can*Self arithmetic unary operator protocols by @jorenham in https://github.com/jorenham/optype/pull/382Can* tests to a more appropriate testing module @jorenham in https://github.com/jorenham/optype/pull/384dprint by @jorenham in https://github.com/jorenham/optype/pull/374tox-uv & more tox envs by @jorenham in https://github.com/jorenham/optype/pull/375lefthook as git hooks manager by @jorenham in https://github.com/jorenham/optype/pull/377ruff to 0.12.4 by @jorenham in https://github.com/jorenham/optype/pull/370_core/_do.py to tests/do.py by @jorenham in https://github.com/jorenham/optype/pull/378uv build backend by @jorenham in https://github.com/jorenham/optype/pull/387Full Changelog: https://github.com/jorenham/optype/compare/v0.12.0...v0.12.1
<!-- Release notes generated using configuration in .github/release.yml at v0.12.0 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.12.0 -->
optypeCan*Self binop protocols by @jorenham in https://github.com/jorenham/optype/pull/348Can binop return type param defaults to input param by @jorenham in https://github.com/jorenham/optype/pull/356Just type-checker compatibility notice by @jorenham in https://github.com/jorenham/optype/pull/357TypeVar naming scheme for the Can* protocols by @jorenham in https://github.com/jorenham/optype/pull/358CanGetSelf[-T, +V] alias for CanGet[T, V, Self] by @jorenham in https://github.com/jorenham/optype/pull/359Can*Same binop protocols by @jorenham in https://github.com/jorenham/optype/pull/362optype.numpyoptype.numpy.Array* type alias docstring fixes by @jorenham in https://github.com/jorenham/optype/pull/353optype.numpy.CanArrayND: remove scalar type parameter default by @jorenham in https://github.com/jorenham/optype/pull/354optype.numpy.compat extended precision inexact types by @jorenham in https://github.com/jorenham/optype/pull/363optype.numpy.To* array-like alias simplifications by @jorenham in https://github.com/jorenham/optype/pull/364optype.numpy array-like types for float16, float32, and complex64 by @jorenham in https://github.com/jorenham/optype/pull/365optype.numpy.ToJust[C]LongDouble* array-like type aliases by @jorenham in https://github.com/jorenham/optype/pull/366mypy to 1.17.0 by @jorenham in https://github.com/jorenham/optype/pull/350basedpyright to 1.30.1 by @jorenham in https://github.com/jorenham/optype/pull/351ruff to 1.12.3 by @jorenham in https://github.com/jorenham/optype/pull/352basedpyright to 1.31.0 by @jorenham in https://github.com/jorenham/optype/pull/367Full Changelog: https://github.com/jorenham/optype/compare/v0.11.0...v0.12.0
<!-- Release notes generated using configuration in .github/release.yml at v0.11.0 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.11.0 -->
optype.numpyoptype.numpy fixes on older numpy versions by @jorenham in https://github.com/jorenham/optype/pull/336optype.numpy.AnyFloat64DType without None by @jorenham in https://github.com/jorenham/optype/pull/346ruff to 0.12.2 by @jorenham in https://github.com/jorenham/optype/pull/341mypy to 1.16.1 by @jorenham in https://github.com/jorenham/optype/pull/342basedpyright to 1.30.0 (pyright 1.1.403) by @jorenham in https://github.com/jorenham/optype/pull/343tox to 4.27.0 by @jorenham in https://github.com/jorenham/optype/pull/344pytest to 8.4.1 by @jorenham in https://github.com/jorenham/optype/pull/345github.ref instead of github.sha in the concurrency.group of CI by @jorenham in https://github.com/jorenham/optype/pull/337Full Changelog: https://github.com/jorenham/optype/compare/v0.10.0...v0.11.0
<!-- Release notes generated using configuration in .github/release.yml at v0.10.0 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.10.0 -->
optype.numpynumpy shape axes by @jorenham in https://github.com/jorenham/optype/pull/317numpy >= 1.25 by @jorenham in https://github.com/jorenham/optype/pull/320NBitBase in optype.numpy.compat by @jorenham in https://github.com/jorenham/optype/pull/326ToJustInt64 numpy array-like aliases for int64 by @jorenham in https://github.com/jorenham/optype/pull/328numpy.CanArrayFunction contravariance assignability fix by @jorenham in https://github.com/jorenham/optype/pull/331optype.numpy.SequenceND compatibility with numpy by @jorenham in https://github.com/jorenham/optype/pull/332ruff to 0.11.4 by @jorenham in https://github.com/jorenham/optype/pull/310python >= 3.11 by @jorenham in https://github.com/jorenham/optype/pull/322ruff to 0.11.11 by @jorenham in https://github.com/jorenham/optype/pull/327scientific-python/repo-review to v0.12.2 by @jorenham in https://github.com/jorenham/optype/pull/324astral-sh/setup-uv to v6 by @jorenham in https://github.com/jorenham/optype/pull/311Full Changelog: https://github.com/jorenham/optype/compare/v0.9.3...v0.10.0
<!-- Release notes generated using configuration in .github/release.yml at v0.9.3 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.9.3 -->
This bugfix release addresses an issue where the 2- and 3-d optype.numpy array-like type aliases were not assignable to their *ND variants, e.g.:
import numpy as np
import optype.numpy as onp
def fn(x: onp.ToFloatND) -> int:
return np.asarray(x).size
def f2(x: onp.ToFloat2D) -> int:
return fn(x) # will no longer be rejected
This additionally works around an issue in typing_extensions==4.13.0 that results in a TypeError being raised when taking the union of typing.TypeAliasType and typing_extension.TypeAliasType on (at least) Python 3.12.
optype.numpyTo{}(2|3)D not being assignable to To{}ND by @jorenham in https://github.com/jorenham/optype/pull/308ruff to 0.11.0 by @jorenham in https://github.com/jorenham/optype/pull/305Full Changelog: https://github.com/jorenham/optype/compare/v0.9.2...v0.9.3
<!-- Release notes generated using configuration in .github/release.yml at v0.9.2 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.9.2 -->
optypeoptype.Just* as @final and simplify metaclasses by @jorenham in https://github.com/jorenham/optype/pull/299optype.JustDate by @jorenham in https://github.com/jorenham/optype/pull/300optype.numpynumpy>=2.2 fixes for array- and dtype-likes by @jorenham in https://github.com/jorenham/optype/pull/301optype.numpy.random submodule by @jorenham in https://github.com/jorenham/optype/pull/302numpy to 2.2.3 by @jorenham in https://github.com/jorenham/optype/pull/292basedmypy to 2.10.0 by @jorenham in https://github.com/jorenham/optype/pull/298v0.9.2 by @jorenham in https://github.com/jorenham/optype/pull/289Full Changelog: https://github.com/jorenham/optype/compare/v0.9.1...v0.9.2
<!-- Release notes generated using configuration in .github/release.yml at v0.9.1 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.9.1 -->
optype.numpyfloat80 and complex160 from [c]longdouble by @jorenham in https://github.com/jorenham/optype/pull/285onp.NDim0, which, unlike NDim, excludes 0 by @jorenham in https://github.com/jorenham/optype/pull/286onp.To[Just]{False,True} aliases by @jorenham in https://github.com/jorenham/optype/pull/287onp.ToArrayStrict{1,2,3}D by @jorenham in https://github.com/jorenham/optype/pull/288ruff to 0.9.4 by @jorenham in https://github.com/jorenham/optype/pull/284v0.9.1 by @jorenham in https://github.com/jorenham/optype/pull/277Full Changelog: https://github.com/jorenham/optype/compare/v0.9.0...v0.9.1
The op.typing.Just* types are deprecated in favor of op.Just*.
<!-- Release notes generated using configuration in .github/release.yml at v0.9.0 -->
import optype as op by deferring submodule imports (https://github.com/jorenham/optype/pull/251)op.io submodule (docs) (https://github.com/jorenham/optype/pull/253)op.Just types (docs):
Just[T] - Accepts _: T iff. type(_) is T.JustInt - Accepts _: int and literal ints, rejects e.g. _: boolJustFloat - Accepts _: float, rejects e.g. _: int and _: numpy.float64JustComplex - Accepts _: complex, rejects _: float and _: numpy.complex128JustBytes - Accepts _: bytes and bytes-literals, rejects _: bytearray, _: memoryview, and _: numpy.bytes_JustObject - Accepts _: object, rejects everything else. Useful for annotating sentinels like DEFAULT = object().op.numpy.is_array_{0,1,2,3,n}d typeguards (docs) (https://github.com/jorenham/optype/pull/270)op.typing.Just* types are deprecated in favor of op.Just*.optypeoptype.HasClass: suprisingly useful! by @jorenham in https://github.com/jorenham/optype/pull/257Just* from optype.typing to optype and deprecate by @jorenham in https://github.com/jorenham/optype/pull/258Just* types by @jorenham in https://github.com/jorenham/optype/pull/260Just without redundant typing hacks by @jorenham in https://github.com/jorenham/optype/pull/261JustObject by @jorenham in https://github.com/jorenham/optype/pull/264JustBytes by @jorenham in https://github.com/jorenham/optype/pull/265HasFunc and HasWrapped generic type params by @jorenham in https://github.com/jorenham/optype/pull/267HasTypeParams type params by @jorenham in https://github.com/jorenham/optype/pull/268optype.numpyJust{Float,Complex} over Just[{float,complex}] in optype.numpy by @jorenham in https://github.com/jorenham/optype/pull/240Just types to onp.Any*DType by @jorenham in https://github.com/jorenham/optype/pull/243optype.numpy.is_ typeguard by @jorenham in https://github.com/jorenham/optype/pull/270op.numpy._any_dtype module into two by @jorenham in https://github.com/jorenham/optype/pull/275optype.numpy.ToDType alias by @jorenham in https://github.com/jorenham/optype/pull/276basedpyright to 1.24.0 by @jorenham in https://github.com/jorenham/optype/pull/255ruff to 0.9.2 by @jorenham in https://github.com/jorenham/optype/pull/259numpy to 2.2.2 (dev-only) by @jorenham in https://github.com/jorenham/optype/pull/263pre-commit to 4.1.0 by @jorenham in https://github.com/jorenham/optype/pull/271CODEOWNERS by @jorenham in https://github.com/jorenham/optype/pull/248optype.io by @jorenham in https://github.com/jorenham/optype/pull/253__future__.annotations and typing.TYPE_CHECKING by @jorenham in https://github.com/jorenham/optype/pull/256ruff.lint.isort config by @jorenham in https://github.com/jorenham/optype/pull/262pyproject.toml by @jorenham in https://github.com/jorenham/optype/pull/269Full Changelog: https://github.com/jorenham/optype/compare/v0.8.0...v0.9.0
<!-- Release notes generated using configuration in .github/release.yml at v0.8.0 -->
<!-- Release notes generated using configuration in .github/release.yml at v0.8.0 -->
optype.numpyoptype.numpy.To*{1,2,3,N} by @jorenham in https://github.com/jorenham/optype/pull/214onp.Any[U]Int{DType,Array} for np.int_ by @jorenham in https://github.com/jorenham/optype/pull/224opt.Just[{int,float,complex}] in onp.Any{Int,Float,Complex}{Array,DType} by @jorenham in https://github.com/jorenham/optype/pull/225onp.compat module, and Any as shape-type default on numpy<2.1 by @jorenham in https://github.com/jorenham/optype/pull/226onp.Matrix and onp.MArray[{0,1,2,3}D] aliases by @jorenham in https://github.com/jorenham/optype/pull/228onp.AnyBytes8DType for np.dtype("c") by @jorenham in https://github.com/jorenham/optype/pull/230onp.ToJust{Bool,Float,Complex} aliases by @jorenham in https://github.com/jorenham/optype/pull/231onp.To[Just]{Float64,Complex128}* aliases by @jorenham in https://github.com/jorenham/optype/pull/232optype.pickleoptype.typingJustFloat and JustComplex to optype.typing by @jorenham in https://github.com/jorenham/optype/pull/215codespell to typos by @jorenham in https://github.com/jorenham/optype/pull/213basedmypy to 2.8.0 and basedpyright to 1.22.1 by @jorenham in https://github.com/jorenham/optype/pull/218Full Changelog: https://github.com/jorenham/optype/compare/v0.7.3...v0.8.0
optype is now on `conda-forge`, thanks to @lucascolley (docs)
optype is now on conda-forge, thanks to @lucascolley (docs)optype.numpy] The CanArrayND type now optionally accepts a second shape-type argument (docs)optype.numpy] New Array0D and CanArray0D aliases for 0-dimensional numpy arrays (not scalars) (docs)optype.numpy] New To*Strict{1,2,3}D array-like types with "strict" shape, useful for non-overlapping shape-type overloads (docs)ImportError on python >= 3.13 without typing_extensions installedruff to 0.8.1 by @jorenham in https://github.com/jorenham/optype/pull/203typing_extensions import on python>=3.13 by @jorenham in https://github.com/jorenham/optype/pull/205onp.CanArrayND shape-type param, improved shape-type compatibility by @jorenham in https://github.com/jorenham/optype/pull/206onp.To*Strict{1,2,3}D: array-like aliases with strict shape-type by @jorenham in https://github.com/jorenham/optype/pull/207typing_extensions imports on python>=3.13 by @jorenham in https://github.com/jorenham/optype/pull/208Full Changelog: https://github.com/jorenham/optype/compare/v0.7.2...v0.7.3
optype.numpy.To*3D - Array-like aliases for 3-D array-likes (docs)
optype.numpy.To*3D - Array-like aliases for 3-D array-likes (docs)optype.numpy.ToJustInt* - Scalar- and array-like aliases for just integer array-likes, i.e. bool and np.bool_ will be rejected (docs)ruff 0.8.0 and basedpyright 1.22.0 by @jorenham in https://github.com/jorenham/optype/pull/195SequenceND from optype.numpy by @jorenham in https://github.com/jorenham/optype/pull/197optype.numpy by @jorenham in https://github.com/jorenham/optype/pull/198ToJustInt scalar- and array-likes in optype.numpy by @jorenham in https://github.com/jorenham/optype/pull/199Full Changelog: https://github.com/jorenham/optype/compare/v0.7.1...v0.7.2
fix onp.ToArray{1,2}D names by @jorenham in https://github.com/jorenham/optype/pull/193
onp.ToArray{1,2}D names by @jorenham in https://github.com/jorenham/optype/pull/193Full Changelog: https://github.com/jorenham/optype/compare/v0.7.0...v0.7.1
optype.types.Deprecated by @jorenham in https://github.com/jorenham/optype/pull/179
optype.numpy.Any* aliases no longer accept bare scalars typesoptype.numpy.Array{1,2,3,N}D (docs)optype.dlpack module with DLPack types and enums (docs)optype.numpy typesJust and JustInt in optype.typing (docs)poetry to uv by @jorenham in https://github.com/jorenham/optype/pull/162ruff format by @jorenham in https://github.com/jorenham/optype/pull/164optype.dlpack: DLPack types and enums by @jorenham in https://github.com/jorenham/optype/pull/169optype.array_api - dtypes by @jorenham in https://github.com/jorenham/optype/pull/170optype.array_api - dtypes" by @jorenham in https://github.com/jorenham/optype/pull/176optype.numpy.CanArray by @jorenham in https://github.com/jorenham/optype/pull/178optype.types.Deprecated by @jorenham in https://github.com/jorenham/optype/pull/179optype.numpy dtypes by @jorenham in https://github.com/jorenham/optype/pull/182optype.numpy.Any* docs by @jorenham in https://github.com/jorenham/optype/pull/183optype.numpy type aliases and protocols by @jorenham in https://github.com/jorenham/optype/pull/184optype.numpy.Array{1,2,3,N}D aliases by @jorenham in https://github.com/jorenham/optype/pull/185typing_extensions.Protocol affecting CanSequence by @jorenham in https://github.com/jorenham/optype/pull/186basedpyright to 1.21.1 (pyright 1.1.389) by @jorenham in https://github.com/jorenham/optype/pull/188ruff to 0.7.4 by @jorenham in https://github.com/jorenham/optype/pull/189Just and JustInt types in optype.typing by @jorenham in https://github.com/jorenham/optype/pull/191optype.numpy.To* coercible scalar- and array-likes by @jorenham in https://github.com/jorenham/optype/pull/192Full Changelog: https://github.com/jorenham/optype/compare/v0.6.1...v0.7.0
This is a bugfix release with no breaking changes. However, because optype now uses less typing.Any, which could cause type-checkers to report errors…
This is a bugfix release with no breaking changes.
However, because optype now uses less typing.Any, which could cause type-checkers to report errors that were previously hidden.
typing.Any uses. See https://github.com/numpy/numpy/pull/27211 for why Any is evil.Full Changelog: https://github.com/jorenham/optype/compare/v0.6.0...v0.6.1
Improvements to `optype.numpy` (it's still optional)
optype.numpy (it's still optional)
numpy.dtypes.StringDType (numpy >= 2)Any*Array and Any*DTypetyping_extensions version from 4.7 to 4.8CanCopy, CanDeepcopy and CanReplace from optype._ to optype.copy._HasDataclassFields from optype._ to optype.dataclasses._CanGetnewargs[Ex], CanReduce[Ex], and Can{Get,Set}state from optype._ to optype.pickle._Any*Array and Any*DType 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
optype.numpy: (optional) NumPy (1 & 2) typing protocols and aliases, see the docs the details
optype.numpy: (optional) NumPy (1 & 2) typing protocols and aliases, see the docs the details*Self aliases for the context manager Can* interfaces*Self aliases for the inplace operand CanI* interfacestyping_extensions is now required for all Python versions <3.13repo-review and tox by @jorenham in https://github.com/jorenham/optype/pull/53*Self aliases for the augmented binop CanI* interfaces by @jorenham in https://github.com/jorenham/optype/pull/82DoesI* inplace binary operator callable protocols by @jorenham in https://github.com/jorenham/optype/pull/83*Self aliases for the unary arithmetic operand interfaces by @jorenham in https://github.com/jorenham/optype/pull/85*Self aliases for context manager interfaces by @jorenham in https://github.com/jorenham/optype/pull/86typing_extensions imports for Protocol and runtime_checkable by @jorenham in https://github.com/jorenham/optype/pull/87optype.numpy: interfaces and type-aliases for numpy by @jorenham in https://github.com/jorenham/optype/pull/55optype.inspect module by @jorenham in https://github.com/jorenham/optype/pull/94Full Changelog: https://github.com/jorenham/optype/compare/v0.4.0...v0.5.0
The minimum required Python version has been lowered from 3.12 to 3.10.
The minimum required Python version has been lowered from 3.12 to 3.10.
basedpyright to 1.10.0 by @jorenham in https://github.com/jorenham/optype/pull/41CONTRIBUTING.md and CODE_OF_CONDUCT.md by @jorenham in https://github.com/jorenham/optype/pull/45Full Changelog: https://github.com/jorenham/optype/compare/v0.3.1...v0.4.0
Update pyright and pre-commit by @jorenham in https://github.com/jorenham/optype/pull/34
Full Changelog: https://github.com/jorenham/optype/compare/v0.3.0...v0.3.1
Fix CanAIterSelf not being an AsyncGenerator subtype by @jorenham in https://github.com/jorenham/optype/pull/17
CanAIterSelf not being an AsyncGenerator subtype by @jorenham in https://github.com/jorenham/optype/pull/17__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__())copy standard library by @jorenham in https://github.com/jorenham/optype/pull/29
CanCopy[T] and CanCopySelfCanDeepcopy[T] and CanDeepcopySelfCanReplace[T, V] and CanReplaceSelf[V]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]dataclasses standard library by @jorenham in https://github.com/jorenham/optype/pull/32
HasDataclassFieldsFull Changelog: https://github.com/jorenham/optype/compare/v0.2.2...v0.3.0
fix incorrect optype.do_ne annotation by @jorenham in https://github.com/jorenham/optype/pull/10
optype.do_ne annotation by @jorenham in https://github.com/jorenham/optype/pull/10optype.DoesIMod annotation by @jorenham in https://github.com/jorenham/optype/pull/11Can* types by @jorenham in https://github.com/jorenham/optype/pull/13CanIterSelf[+V] and CanAIterSelf[+V] by @jorenham in https://github.com/jorenham/optype/pull/14__len__ and __length_hint__ by @jorenham in https://github.com/jorenham/optype/pull/15Full Changelog: https://github.com/jorenham/optype/compare/v0.2.1...v0.2.2
Bump pytest from 8.0.2 to 8.1.1 by @dependabot in https://github.com/jorenham/optype/pull/5
do_bool: DoesBooldo_int: DoesIntdo_float: DoesFloatdo_complex: DoesComplexdo_bytes: DoesBytesdo_str: DoesStrexamples/ directoryFull Changelog: https://github.com/jorenham/optype/compare/v0.2.0...v0.2.1
add 72 operators as optype.do_*, so that optype > operator
optype.do_*, so that optype > operatoroptype.Does*CanA{name} types as CanA{Name}, improving readabilityFull Changelog: https://github.com/jorenham/optype/compare/v0.1.0...v0.2.0
The official first release of optype 🎉.
The official first release of optype 🎉.
Full Changelog: https://github.com/jorenham/optype/commits/v0.1.0
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →