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
Add annotation stubs for
PyGraph
andPyDiGraph
#401Add annotation stubs for
PyGraph
andPyDiGraph
#401Changes from all commits
be25f8b
1292561
cd98bda
7cc697d
12b39e2
6fa0cf9
aa3bcd9
e799e0f
e6cec75
ec48656
3691bf4
78d458b
fe73243
530b26d
48b536e
05b2cf2
f6e37a9
0c3e735
87d0834
1b3b747
bb1cf8f
e460c11
acc7e4b
81aec08
ff4139e
e31ea49
f36255f
69fd764
49eb24f
8777705
b448d34
e986c53
7ce2b9b
e1feaf2
837efb2
0ceac47
7e2f883
827a014
047daba
68d3310
44a59de
f8f9341
baa61e8
546f6ee
54b5c93
ac6825a
00c8852
fa34487
4e64fa5
93685fa
9803970
c208f2d
7190bf5
b35bb02
16df41c
6506370
28ce1cc
7d964af
e025617
a83cce7
59a9f90
c3dad55
ed8ea1c
63c87a6
ed0c053
54a795c
8f22bb7
342d2f5
937d049
23c9a6d
d0cb298
fc16d41
b34afe4
2bb0ac3
42f77ac
ff58a0c
0cab9fe
a7aaf48
20777a6
e1a8e19
e1798e5
f6bc49f
0cd9c9f
dc0d9b3
ad83bab
2da1178
f91ab74
05c7d60
37d3c23
5e9c86e
c24f8f8
a441d39
265fbe9
c16ae22
9a21cae
119cdb3
fb27883
968f9d3
5ed884b
4eab027
91a1f27
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.
I was a little surprised to learn that PyO3 won't convert
Iterable
as a valid conversion type forVec<_>
, but you're definitely correct with the hint here. I guess maybe PyO3 didn't want to do conversions that require multiple reallocations.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.
PyO3 has some weird quirks with iterations (e.g. #614 that broke us) so sometimes I just accept the
Vec<_>
conversion and if it is not in our tests it is not "canonical"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.
Numpy technically provide stronger type hints now, and
Unpack
+TypeVarTuple
give some sort of way of specifying ndarray shapes / dtypes. Unless you particularly want to look into that right now, though, I'd not worry about it in favour of just landing this PR.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.
Again, this could be done later if you'd rather just land the PR:
I think there's a way to teach type checkers that the return type is dependent on the types of one of the arguments. It's made more complex because of the default value of the argument, so I don't precisely know the correct syntax, but it's something like
I don't remember exactly how you sort out the syntax in a typing stub to combine the overload with the default value, but it's something along those lines.
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 like this, I will try implementing it