File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,15 @@ Two exceptions are `Protocol` and `runtime_checkable`: although
286
286
these were added in Python 3.8, they can be used in stubs regardless
287
287
of Python version.
288
288
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
+ Often one of the aliases from ` _typeshed ` , such as
296
+ ` _typeshed.ReadableBuffer ` , can be used instead.
297
+
289
298
### What to include
290
299
291
300
Stubs should include the complete interface (classes, functions,
You can’t perform that action at this time.
0 commit comments