Skip to content

Commit d6a63ae

Browse files
committed
Soft deprecations
1 parent dee2be5 commit d6a63ae

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

peps/pep-0782.rst

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ Abstract
1717

1818
Add a new ``PyBytesWriter`` C API to create ``bytes`` objects.
1919

20-
It replaces the ``PyBytes_FromStringAndSize(NULL, size)`` and
21-
``_PyBytes_Resize()`` APIs which treat an immutable ``bytes`` object as
22-
a mutable object.
20+
Soft deprecate ``PyBytes_FromStringAndSize(NULL, size)`` and
21+
``_PyBytes_Resize()`` APIs. These APIs treat an immutable ``bytes``
22+
object as a mutable object. They remain available and maintained, don't
23+
emit deprecation warning, but are no longer recommended when writing new
24+
code.
2325

2426

2527
Rationale
@@ -188,6 +190,18 @@ Thread safety
188190
The API is not thread safe: a writer should only be used by a single
189191
thread at the same time.
190192
193+
Soft deprecations
194+
-----------------
195+
196+
Soft deprecate ``PyBytes_FromStringAndSize(NULL, size)`` and
197+
``_PyBytes_Resize()`` APIs. These APIs treat an immutable ``bytes``
198+
object as a mutable object. They remain available and maintained, don't
199+
emit deprecation warning, but are no longer recommended when writing new
200+
code.
201+
202+
``PyBytes_FromStringAndSize(str, size)`` is not soft deprecated. Only
203+
calls with ``NULL`` *str* are soft deprecated.
204+
191205
192206
Examples
193207
========

0 commit comments

Comments
 (0)