Beartype 0.10.4 released.
This patch release adumbrates with breathless support for mypy ≥ 0.940, the static type checker formerly known as "The Static Type Checker Whose Name Shall not Be Spoken."
This patch release resolves 5 issues and merges 0 pull requests. Noteworthy changes include:
Compatibility Improved
- mypy ≥ 0.940. The
beartype
codebase now sports improved compatibility with the recently released mypy 0.94x series, which previously outted the@beartype
decorator with a "Condition can't be inferred, unable to merge overloads [misc]" fatal error at static type-checking time. Specifically, this release fundamentally refactors (and in so doing mildly optimizes) our privatebeartype._decor.main
submodule to leverage conditional overloads under the astute tutelage of mypy maestro @cdce8p; the@beartype.beartype
decorator itself now resides in a new privatebeartype._decor.cache.cachedecor
submodule, because obfuscation is the key to all successful open-source efforts. Doing so resolves issues #111 and #112 dual-reported concurrently by cutting-edge Microsoft luminary @daxpryce and German typing bad-ass @twoertwein.
Features Optimized
- Importation time. The first external importation from the
beartype
codebase is now significantly faster when the definition of the@beartype.beartype
decorator reduces to a noop (e.g., due topython3 -O
optimization), partially resolving issue #94 kindly requested by the well-tanned and -toned typing star @matanster.
Issues Resolved
beartype.abby
underpython3 -O
. This release resolves an unreported critical defect in our new functional API (i.e., the pair ofbeartype.abby.is_bearable()
andbeartype.abby.die_if_unbearable()
functions), which previously reduced to a noop when the@beartype.beartype
decorator reduced to a noop (e.g., due topython3 -O
optimization). By extricating the@beartype.beartype
decorator into thebeartype._decor.cache.cachedecor
submodule (as described above), our functional API now directly defers to that decorator regardless of what thebeartype
package externally presents to third-party code.
(Ironwrought irony untaught!)