-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Track review of bytes
types
#9006
Comments
One quick note: I believe we're missing a type that corresponds to |
@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 |
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. |
Technically it accepts any buffer, but the inline type annotations now say bytes | bytearray, so let's stick to that. Part of python#9006
Technically it accepts any buffer, but the inline type annotations now say bytes | bytearray, so let's stick to that. Part of #9006
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
|
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 & stripe/stripe-python#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.bytes
usage ofpathlib
#9016)stubs/redis/redis/asyncio/client.pyi (7 usages)stubs/redis/redis/asyncio/connection.pyi (11 usages)stubs/redis/redis/asyncio/lock.pyi (5 usages)stubs/redis/redis/client.pyi (9 usages)stubs/redis/redis/commands/core.pyi (5 usages)stubs/redis/redis/connection.pyi (14 usages)stubs/redis/redis/lock.pyi (4 usages)stubs/redis/redis/sentinel.pyi (1 usages)stubs/redis/redis/typing.pyi (5 usages)stubs/redis/redis/utils.pyi (2 usages)The text was updated successfully, but these errors were encountered: