Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit by Harvard microscopist and general genius @tlambert03 defines a new public `beartype.math` subpackage for performing type hint arithmetic, resolving issues #133 and #138 kindly also submitted by @tlambert03. Specifically, this commit defines a: * Public `beartype.math.TypeHint({type_hint})` class, enabling rich comparisons between pairs of arbitrary type hints. Altogether, this class implements a partial ordering over the countably infinite set of all type hints. Pedagogical excitement ensues. * Public `beartype.math.is_subtype({type_hint_a}, {type_hint_b})` class, enabling @beartype users to decide whether any type hint is a **subtype** (i.e., narrower type hint) of any other type hint. Thanks so much to @tlambert03 for his phenomenal work here. (*Compelling compulsion of propulsive propellers!*)
- Loading branch information