-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Out-of-band
beartype.peps.resolve_pep563()
.
This commit resolves a critical edge case in our **PEP 563 resolver** (i.e., the public `beartype.peps.resolve_pep563()` function), resolving issue #245 kindly submitted by @machow (Michael Chow). Specifically, this commit relaxes our own self-imposed internal constraints on the resolution of the local lexical scope of the passed callable. Doing so enables `resolve_pep563()` to resolve PEP 563-postponed type hints "out-of-band," by which we mean *after* the declaration of a callable and thus *after* the local lexical scope of that callable has already been deleted from the call stack. Likely more importantly, doing so significantly improves the human-readability of exceptions raised by `resolve_pep563()` for **missing forward references** (i.e., type hints referring to undefined types that are *not* actually defined anywhere). (*Casual causality obliterates the irate literacy in a city!*)
- Loading branch information
Showing
5 changed files
with
193 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.