Skip to content

Beartype 0.16.4

Compare
Choose a tag to compare
@github-actions github-actions released this 21 Oct 04:52
· 173 commits to main since this release

This patch release resolves all the bad things that have quietly gone unnoticed by both man and Maine Coon alike... until now. Fellow Ontarian and ML superstar @MaximilienLC (Maximilien Le Cleï) seriously, what is up with that "ï" quietly called our attention to a bevy (pretty sure that means "alot") of outstanding badness riddling the @beartype codebase.

This patch release resolves that badness. This means:

  • beartype.claw + methods + PEP 526. Previously, beartype.claw silently failed to type-check PEP 526-compliant annotated variable assignments in methods. Now, beartype.claw does so: e.g.,

    # In "{your_sagacious_package}.__init__":
    from beartype import beartype_this_package
    beartype_this_package()
    
    # In "{your_sagacious_package}...{your_bodacious_module}":
    class SoMuchClass(object):
        def so_much_method(self) -> None:
            # "beartype.claw" now raises an exception on this violation. Yah!
            so_much_local: int = 'You no longer fool @beartype, local."
    
            # "beartype.claw" also raises an exception on this violation. Go!
            self.so_much_var: int = 'You too are known to @beartype, variable."
  • @beartype 0.16.3 inheritance regression. @beartype's prior stable release (i.e., @beartype 0.16.3) introduced a critical regression with respect to inheritance and type-checking. Notably, the @beartype decorator silently failed to type-check subclass methods overriding superclass methods under @beartype 0.16.3. Now, it does. I implore you all to believe that this never happened... Believe!

Much thanks to @MaximilienLC for his all-seeing eye, which sees all @beartype's typing failures as plainly as I see the blinding glare off my bald and malding head. (Pretty itsy-bitsy nitty-gritty, innit?)