Open JelleZijlstra opened 1 year ago
One quick note: I believe we're missing a type that corresponds to Buffer & Sequence[int]
. If such a type is ever needed and PEP 688 is accepted and we alias the buffer types in typeshed to types.Buffer, we'll get false negatives. So possibly a thing to look out for and introduce if necessary (_typeshed.ByteSequence
?)
(I wouldn't waste time wading through all the cryptography
ones, given how out of date those stubs are — we should just work on getting #5768 done so that we can do #5618.)
@hauntsaninja so far I haven't seen much use for that; usually people either want some subset or Sequence, or the buffer protocol, but not both.
@AlexWaygood thanks, that saves a lot of files.
I'm also going to skip all of the deleted and deprecated modules (e.g. from PEP 594) since they're unlikely to affect real users.
I've ticked off stubs/xxhash/xxhash/__init__.pyi
for you as well, since those stubs are obsolete and scheduled for removal (#7142)
I am going to stop sending PRs for now since I have >10 open PRs. I'd appreciate reviews on the open ones. :)
I've ticked off the urllib3 ones, since our stubs for urllib3 are obsolete and scheduled for removal.
Found an issue with stubs/requests/requests/models.pyi, seems its reporting the return type of Response.content to be bytes, but it seems its return type in the sourcecode is bytes | bool | None
Not sure if this is intended or not. Can help with a PR for it
Thanks for checking! Please open a PR (or a separate issue if you're not sure).
I don't know if I'll get around to all the third-party stubs. For a lot of these files it doesn't seem like we're gaining that much by adjusting the bytes types.
Checked the tree_sitter
checkbox, no changes were needed since it only accepts bytes
.
Stripe should resolve itself as 6.8.0b3 includes inline-types https://github.com/stripe/stripe-python/blob/v6.8.0b3/CHANGELOG.md#enable-inline-type-annotations-in-the-beta-channel & https://github.com/stripe/stripe-python/pull/1074
I'll use this issue to track reviewing all usage of
bytes
types to see if they should be changed following #9001 and PEP 688. The below list is fromgit grep -c '\bbytes\b'
.My plan is to do look at each file one by one, reviewing
bytes
occurrences. I'll generally assume occurrences in return types orIO[bytes]
are correct, but check occurrences in argument types to see if they should beReadableBuffer
,bytes
, or similar.