Skip to content

Commit 6011132

Browse files
committed
Add a note about type checking.
1 parent 58e57a4 commit 6011132

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Doc/c-api/bytes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ called with a non-bytes parameter.
234234
Get the string representation of *bytes*. This function is currently used to
235235
implement :meth:`!bytes.__repr__` in Python.
236236
237+
This function does not do type checking; it is undefined behavior to pass
238+
*bytes* as a non-bytes object or ``NULL``.
239+
237240
If *smartquotes* is true, the representation will use a double-quoted string
238241
instead of single-quoted string when single-quotes are present in *bytes*.
239242
For example, the byte string ``'Python'`` would be represented as

0 commit comments

Comments
 (0)