Skip to content

Commit 09ae69c

Browse files
CONTRIBUTING: Note no bytearray promotion
Closes #9001
1 parent 5bcd4c1 commit 09ae69c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,13 @@ Two exceptions are `Protocol` and `runtime_checkable`: although
286286
these were added in Python 3.8, they can be used in stubs regardless
287287
of Python version.
288288

289+
[PEP 688](https://www.python.org/dev/peps/pep-0688/), which is
290+
currently a draft, removes the implicit promotion of the
291+
`bytearray` and `memoryview` classes to `bytes`.
292+
Typeshed stubs should be written assuming that this proposal
293+
is accepted, so a parameter that accepts either `bytes` or
294+
`bytearray` should be typed as `bytes | bytearray`.
295+
289296
### What to include
290297

291298
Stubs should include the complete interface (classes, functions,

0 commit comments

Comments
 (0)