Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
PEP 724: Stricter TypeGuard #3266
PEP 724: Stricter TypeGuard #3266
Changes from 74 commits
f5205c6
9da9233
00d5247
79720d5
4c4a0e9
4f90e9c
faa5768
f00e7a2
c895a0a
5305af4
b6335f0
f24ca7c
cbf907a
dea607f
e5a71ea
a32efa4
708f60c
662341f
24b88ba
a682219
6287be5
a2e0b22
66bdf14
5850d66
31fb9c7
641b761
1ec2207
ce63130
6184c24
00e028c
7ab28d9
dddc7cb
7e51159
68e73a3
a9b0407
106f10a
e44d060
07af8f7
81bc56c
535ab81
7b69948
ddc4ec3
dd4bf80
5eab931
c5449b8
6ff5be9
487a47e
4f9753a
3c37ec3
27bac54
b90df2c
3263b63
dcf3d49
598d0da
a580f4a
95d4616
b267456
6b246f2
0e24a6f
457ea0e
5ff0408
b91a5ca
d8ea2cc
671df1f
d3048de
4a7039e
e3fd558
bccb5fb
e5f4749
25fc119
44a31ae
93b1503
499639f
b181ef9
5963e45
867c541
2a2336a
dd5fdee
92768e2
159c519
8f28e7a
678ce5f
f817e07
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduction to the Specification seems a bit odd / doesn't flow very well -- you start with "Given a function" and then in the next paragraph define a series of types with no reference or connection to the previous paragraph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry but I'm not sure which parts aren't referencing each other. Did you mean the Kangaroo | Koala example? Or the reference to the different types : 'P, R, A, NP, NN'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did the update clarify this at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was initially a little confused here, as this PEP doesn't propose
Intersection[]
orNegate[]
, but then I realised you probably mean achieving an intersection by using multiple type guards -- would it be worth adding a line of disambiguation?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it doesn't mean achieving an intersection using multiple type guards. It means that strict type guards use intersection to define what they return. The return type of a strict type guard is the intersection of the input type (A) and the return type (R). This intersection isn't defined in Python yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pyright has its own implementation of this intersection at the moment.