-
-
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.
Postponed evaluation of PEP 563-compliant type aliases.
This commit generalizes @beartype's support for forward references from **type forward references** (i.e., references to user-defined *types* that have yet to be defined in the current lexical scope) to **subscripted generic type alias forward references** (i.e., references to type aliases (that have yet to be defined in the current lexical scope and thus require forward references) to subscripted generics that have been defined), resolving feature request #222 kindly submitted by Google X JAX "Acronym Maestro" @patrick-kidger (Patrick Kidger). Specifically, this commit: * Generalizes our private `beartype._check.forward.fwdtype._Beartypistry.__missing__()` dunder method to support both: * **Subscripted generics** (e.g., `MuhGeneric[int]`). * **Isinstanceable types** (e.g., `MuhGeneric`). * Unit tests this generalization. (*Subordinate insubordination is notional at best, ordinal!*)
- Loading branch information
Showing
6 changed files
with
103 additions
and
80 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
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.