File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,23 @@ called with a non-bytes parameter.
228228 The function is :term: `soft deprecated `,
229229 use the :c:type: `PyBytesWriter ` API instead.
230230
231+
232+ .. c :function :: PyObject *PyBytes_Repr (PyObject *bytes, int smartquotes)
233+
234+ Get the string representation of *bytes *. This function is used to
235+ implement :meth: `bytes.__repr__ ` in Python.
236+
237+ If *smartquotes * is true, the representation will use a double-quoted string
238+ instead of single-quoted string when single-quotes are present in *bytes *.
239+ For example, the byte string ``'Python' `` would be represented as
240+ ``b"'Python'" `` when *smartquotes * is true, or b'\' Python\' ' when it is
241+ false.
242+
243+ On success, this function returns a :term: `strong reference ` to a
244+ :class: `str ` object containing the representation. On failure, this
245+ returns ``NULL `` with an exception set.
246+
247+
231248.. _pybyteswriter :
232249
233250PyBytesWriter
You can’t perform that action at this time.
0 commit comments