10000 CONTRIBUTING: Note no bytearray promotion by JelleZijlstra · Pull Request #9005 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

CONTRIBUTING: Note no bytearray promotion #9005

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

Merged
merged 3 commits into from
Oct 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,15 @@ Two exceptions are `Protocol` and `runtime_checkable`: although
these were added in Python 3.8, they can be used in stubs regardless
of Python version.

[PEP 688](https://www.python.org/dev/peps/pep-0688/), which is
currently a draft, removes the implicit promotion of the
`bytearray` and `memoryview` classes to `bytes`.
Typeshed stubs should be written assuming that this proposal
is accepted, so a parameter that accepts either `bytes` or
`bytearray` should be typed as `bytes | bytearray`.
Often one of the aliases from `_typeshed`, such as
`_typeshed.ReadableBuffer`, can be used instead.

### What to include

Stubs should include the complete interface (classes, functions,
Expand Down
0