mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user