-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Implement TypeIs (PEP 742) #16898
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
Implement TypeIs (PEP 742) #16898
Changes from 1 commit
8a30073
58e8403
c8d2af8
f205910
75c9dec
4666486
25a9c79
faa4a07
c0e0210
f107e5b
34700bb
065ec92
aef3036
4b19c77
6b0e749
c9e53e6
909e53c
eb88371
1b1e368
84c69d2
ae294bf
7fedbcf
dbc229d
8b2fb0b
816fd1a
d6fcc35
ef825ce
d32956d
a36a16a
b32ba80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Co-authored-by: Marc Mueller <[email protected]>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -285,7 +285,6 @@ main:5: note: def is_float(self, a: object) -> bool | |
| [case testTypeIsInAnd] | ||
| from typing import Any | ||
| from typing_extensions import TypeIs | ||
| import types | ||
| def isclass(a: object) -> bool: | ||
| pass | ||
| def ismethod(a: object) -> TypeIs[float]: | ||
|
|
@@ -661,7 +660,7 @@ if typeguard(y="42", x=x): | |
|
|
||
| [case testGenericAliasWithTypeIs] | ||
| from typing import Callable, List, TypeVar | ||
| from typing_extensions import TypeIs, TypeAlias | ||
| from typing_extensions import TypeIs | ||
|
|
||
| A = Callable[[object], TypeIs[List[T]]] | ||
|
Member
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.
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. This is a general issue with test cases that I've seen in other tests as well. I'm not sure if T is coming from the builtins stubs or whatever else. If you are really interested I could quickly try and search where this has happened. Obviously still good to point it out and change it here. 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 think the root cause of this is that a normal It would probably be a good idea to change all fixtures, but that might be quite a bit of work.
Member
Author
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. Added an explicit definition of |
||
| def foo(x: object) -> TypeIs[List[str]]: ... | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.