This release delivers eleventh-hour support for the NotImplemented
singleton and improved compliance with static analysis tooling like static type-checkers (e.g., mypy) and intelligent IDEs (e.g., not Vim). This release resolves 4 outstanding issues and merges 1 pending pull request.
Changes include:
Compatibility Improved
NotImplemented
singleton.@beartype
now explicitly supports the builtinNotImplemented
singleton with the same behaviour implemented by mypy to support this singleton, resolving issue #38 kindly reported by Matt the positive @posita. Specifically,@beartype
now implicitly coerces binary dunder methods (e.g.,__eq__()
) annotated as returning booleans to instead be annotated as returning either booleans or theNotImplemented
singleton (e.g., fromdef __eq__(self, other: object) -> bool
todef __eq__(self, other: object) -> Union[bool, type(NotImplemented)]
).- Static analysis.
@beartype
now better complies with static analysis performed by both static type-checkers (e.g., mypy) and intelligent IDEs (e.g., not Vim), resolving both issues #36 (kindly reported by @jonathanmorley the majestic code maestro) and #39 (again kindly reported by Matt the positive @posita). Specifically, the@beartype
decorator itself is now annotated as returning a callable having the exact same signature as the passed callable. Previously,@beartype
was annotated as merely returning a callable of arbitrary signature. Thanks again to @jonathanmorley the majestic code maestro for both the initial issue and pull request resolving that issue!
(Frenetic phrenology eulogizes occipital antics!)