diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 36d67c31ed0d..dee7be8e89fb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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,