Beartype

Latest version: v0.18.5

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

Scan your dependencies

Page 1 of 8

3.9

Tests Improved

* **Third-party package tests restored.** Unit tests conditionally depending upon the importability of third-party packages have been restored to their prior working state after an embarassingly elongated period of being ignored. These include:
* The `test_api_cave_lib_numpy()` unit test exercising NumPy integration in the `beartype.cave` submodule.
* The `test_api_cave_lib_setuptools()` unit test exercising `setuptools` integration in the `beartype.cave` submodule.

API Changed

* In the `beartype.roar` submodule:
* Added:
* `BeartypeDecorHintPepDeprecatedWarning`.
* Removed:
* `BeartypeCallHintNonPepException`.
* `BeartypeCallHintNonPepParamException`.
* `BeartypeCallHintNonPepReturnException`.

(*Styled turnstiles burn mile-high piles of corrugated corruption!*)

0.18.5

The beartype 0.18.X release cycle continues to *bear* lukewarm fruit that tastes vaguely starchy. It's cheap and smells faintly of kerosene. It keeps the hunger at bay even as it fails to fully satiate.

Beartype 0.18.5 preserves this trend by resolving... *just a single issue!* Beartype 0.18.5 resolves a critical low-level issue in beartype's dynamic type-checking code generator for **nested beartype validator-in-container type hints** (e.g., type hints of the form `list[typing.Annotated[{type}, Is[{validator}]]]`). Someone, somewhere cares deeply about this. You might even be that someone.

Hype is completely out the window at this point, everybody. We're just hardening the fat-packed abs of the bear against critical breakage, because your codebase matters more to us than our sleep. And now...

This release comes courtesy these proud [GitHub Sponsors](https://github.com/sponsors/leycec), without whom leycec's cats would currently be eating grasshoppers:

* sesco-llc (SESCO Enterprises), "The Power of Innovation in Trading": <sup>*this inspires me to get out of the house and do something*</sup>
https://sescollc.com
* DylanModesitt (Dylan Modesitt), quantitative strategies energy trading associate: <sup>*...wikipedia, don't fail me now!*</sup>
https://dylanmodesitt.com
* tactile-metrology (Tactile Metrology), "Software and hardware that you can touch." When I want to be touched by software and hardware, I call tactile-metrology:
https://metrolo.gy <sup>imagine if this domain actually worked. *how cool would that be!?*</sup>

Thanks so much, masters of fintech and metrology.

![](https://media1.tenor.com/m/7JR7sD8oTiUAAAAC/who-are-you-do-i-know-you.gif)
<sup>The Masters of Fintech and Metrology. *That's who.*</sup>

0.18.4

The beartype 0.18.X release cycle continues to *bear* lukewarm fruit that tastes vaguely starchy. It's cheap and smells faintly of kerosene. It keeps the hunger at bay even as it fails to fully satiate.

Beartype 0.18.4 preserves this trend by resolving... *just a single issue!* Beartype 0.18.4 resolves a critical low-level issue in beartype's dynamic type-checking code generator for **nested tuple-in-dictionary type hints** (i.e., type hints of the form `dict[tuple[...], ...]`). Someone, somewhere cares deeply about this. You might even be that someone.

Hype is completely out the window at this point, everybody. We're just hardening the fat-packed abs of the bear against critical breakage, because your codebase matters more to us than our sleep. And now...

This release comes courtesy these proud [GitHub Sponsors](https://github.com/sponsors/leycec), without whom leycec's cats would currently be eating grasshoppers:

* sesco-llc (SESCO Enterprises), "The Power of Innovation in Trading": <sup>*this inspires me to get out of the house and do something*</sup>
https://sescollc.com
* DylanModesitt (Dylan Modesitt), quantitative strategies energy trading associate: <sup>*...wikipedia, don't fail me now!*</sup>
https://dylanmodesitt.com
* tactile-metrology (Tactile Metrology), "Software and hardware that you can touch." When I want to be touched by software and hardware, I call tactile-metrology:
https://metrolo.gy <sup>imagine if this domain actually worked. *how cool would that be!?*</sup>

Thanks so much, masters of fintech and metrology.

![](https://media1.tenor.com/m/7JR7sD8oTiUAAAAC/who-are-you-do-i-know-you.gif)
<sup>The Masters of Fintech and Metrology. *That's who.*</sup>

0.18.3

python
from beartype import beartype
from typing_extensions import Self

beartype
class MyClass:
attribute: int

def __init__(self, attr: int) -> None:
self.attribute = attr

def __add__(self, other: int) -> Self:
self.__class__(self.attribute + other)


If you wanted this, you are literally iamrecursion. Congrats.

![](https://media1.tenor.com/m/LM2gxeKVa0IAAAAC/p5-persona.gif)
<sup>you too will believe that beartype 0.18.3 actually works</sup>

Ping 'Em All

Pinging posita, iamrecursion, sylvorg, tactile-metrology, kalaspuff, danielward27, kloczek, uriyasama, danielgafni, JWCS, rbroderi, AlanCoding, tvdboom, crypdick, WeepingClown13, RobPasMue, rbnhd, radomirgr, rbroderi.

You are wanted on floor 13. Japanese buildings don't even *have* a floor 13. Surely nothing could go wrong by violating that fundamental.

![](https://media1.tenor.com/m/ffGtDU9FVdAAAAAC/persona5-joker.gif)
<sup>*those dance moves can mean only one thing...* This was beartype 0.18.3.</sup>

0.18.2

None

0.18.1

Much like your neighbour's obese cat, beartype 0.18.0 didn't quite work out as expected. This patch release temporarily reverts **default value type-checking** (i.e., type-checking of default values of optional parameters annotated by type hints accepted by `beartype`-decorated callables), restoring sanity to the downstream community of beartype consumers.

Although desirable, this functionality is also *a lot* more nuanced than leycec previously assumed -- resulting in leycec clutching his bald head as if he still had something to clutch there. Since improving this functionality to be robust against breakage is non-trivial, the proper solution is to temporarily disable that functionality. Thus, we cry.

Obligatory awesome peeps!

GitHub Sponsors: They Scratch the Bear's Back. Now, The Bear Scratches Back.

This release comes courtesy these proud [GitHub Sponsors](https://github.com/sponsors/leycec), without whom leycec's cats would currently be eating grasshoppers:

* sesco-llc (SESCO Enterprises), "The Power of Innovation in Trading": <sup>*this inspires me to get out of the house and do something*</sup>
https://sescollc.com
* DylanModesitt (Dylan Modesitt), quantitative strategies energy trading associate: <sup>*...wikipedia, don't fail me now!*</sup>
https://dylanmodesitt.com

Thanks so much, masters of fintech.

![](https://media1.tenor.com/m/7JR7sD8oTiUAAAAC/who-are-you-do-i-know-you.gif)
<sup>The Masters of Fintech. *That's who.*</sup>

Page 1 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.