*len* on success, and ``NULL`` on failure. If *v* is ``NULL``, the contents of
the bytes object are uninitialized.
+ .. deprecated:: 3.15
+ ``PyBytes_FromStringAndSize(NULL, len)`` is :term:`soft deprecated`,
+ use the :c:type:`PyBytesWriter` API instead.
+
.. c:function:: PyObject* PyBytes_FromFormat(const char *format, ...)
*\*bytes* is set to ``NULL``, :exc:`MemoryError` is set, and ``-1`` is
returned.
+ .. deprecated:: 3.15
+ The function is :term:`soft deprecated`,
+ use the :c:type:`PyBytesWriter` API instead.
+
+
PyBytesWriter
-------------
signed integer type of the same size is now deprecated.
(Contributed by Serhiy Storchaka in :gh:`132629`.)
+* :c:func:`PyBytes_FromStringAndSize(NULL, len) <PyBytes_FromStringAndSize>`
+ and :c:func:`_PyBytes_Resize` are :term:`soft deprecated`,
+ use the :c:type:`PyBytesWriter` API instead.
+ (Contributed by Victor Stinner in :gh:`129813`.)
+
* Deprecate :c:member:`~PyComplexObject.cval` field of the the
:c:type:`PyComplexObject` type.
Use :c:func:`PyComplex_AsCComplex` and :c:func:`PyComplex_FromCComplex`