Skip to content

Commit

Permalink
beartype.peps.resolve_pep563() refactor x 2.
Browse files Browse the repository at this point in the history
This commit is the last in a commit chain fundamentally refactoring our
public **PEP 563 resolver** (i.e., the `beartype.peps.resolve_pep563()`
function) from its current ad-hoc (and frankly broken) implementation to
our newly resuscitated support for stringified type hints via our
private `beartype._check.forward.fwdhint.resolve_hint()` function.
Specifically, this commit finalizes:

* Refactoring the existing `beartype.peps.resolve_pep563()` function.
* Unit testing that function via the existing
  `test_resolve_pep563()` unit test.

(*Salacious salad in a loquacious colocation!*)
  • Loading branch information
leycec committed Sep 1, 2023
1 parent a98121f commit fa5389a
Show file tree
Hide file tree
Showing 6 changed files with 233 additions and 567 deletions.
6 changes: 2 additions & 4 deletions beartype/_decor/_decormore.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
)
from beartype._decor.wrap.wrapmain import generate_code
from beartype._util.cache.pool.utilcachepoolobjecttyped import (
acquire_object_typed,
release_object_typed,
)
release_object_typed)
from beartype._util.func.mod.utilbeartypefunc import (
is_func_unbeartypeable,
set_func_beartyped,
Expand Down Expand Up @@ -153,7 +151,7 @@ def beartype_func(
# already decorated by @beartype by efficiently reducing to a noop.
set_func_beartyped(func_wrapper)

# Release this callable metadata back to its object pool.
# Release this beartype call metadata back to its object pool.
release_object_typed(bear_call)

# Return this wrapper.
Expand Down

0 comments on commit fa5389a

Please sign in to comment.