-
-
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.
Forward reference
issubclass()
proxying x 2.
This commit is the last in a commit chain generalizing our support for subscripted forward references (e.g., `"type[MuhClass]"`) to proxy both `isinstance()` *and* `issubclass()` type-checks, resolving issue #289 kindly submitted by Google X extraordinaire @patrick-kidger (Patrick Kidger). Previously, subscripted forward references erroneously proxied only `isinstance()` type-checks; this omission prevented these references from correctly resolving subscriptions of the PEP 585-compliant `type[...]` builtin by a forward reference to a class that has yet to be defined. Specifically, this commit: * Improves forward reference proxies to additionally proxy both the fully-qualified names of the modules declaring the classes to which they refer *and* the unqualified basenames of those classes. Doing so substantially improves the readability of exception messages involving forward reference proxies. * Exhaustively unit tests this generalization. Praise be to the Kidger. (*Sole enmity or an itty-bitty solemnity?*)
- Loading branch information
Showing
9 changed files
with
241 additions
and
87 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
File renamed without changes.
File renamed without changes.
Empty file.
Oops, something went wrong.