-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-132493: lazy evaluation of annotations in typing._proto_hook
#132534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
34c6039
8ad1181
079cf59
998e83c
92e5ab9
3413f78
a82ac39
8c7a1e9
63e5a5b
a820f7f
19d925a
316741e
3d13c56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4557,14 +4557,24 @@ class Commentable(Protocol): | |
def test_isinstance_with_deferred_evaluation_of_annotations(self): | ||
@runtime_checkable | ||
class P(Protocol): | ||
x: undefined | ||
x: undefined | int | ||
def meth(self): | ||
... | ||
|
||
class DeferredClass: | ||
x: undefined | ||
|
||
class DeferredClassImplementingP: | ||
x: undefined | int | ||
|
||
def __init__(self): | ||
self.x = 0 | ||
|
||
def meth(self): | ||
... | ||
|
||
self.assertFalse(isinstance(DeferredClass(), P)) | ||
self.assertTrue(isinstance(DeferredClassImplementingP(), P)) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also add a test with a class that does fulfill the protocol. Also, please add a NEWS entry. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a class that satisfies the protocol and a NEWS entry:) |
||
|
||
class GenericTests(BaseTestCase): | ||
|
Uh oh!
There was an error while loading. Please reload this page.