gh-71679: Share the repr implementation between bytes and bytearray (GH-138181)

This allows to use the smart quotes algorithm in the bytearray's repr.
This commit is contained in:
Serhiy Storchaka 2025-09-17 11:10:29 +03:00 committed by GitHub
parent cf9ef73121
commit a1cf6e92b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 30 additions and 93 deletions

View file

@ -47,6 +47,9 @@ extern PyObject *_Py_bytes_endswith(const char *str, Py_ssize_t len,
/* The maketrans() static method. */
extern PyObject* _Py_bytes_maketrans(Py_buffer *frm, Py_buffer *to);
/* Helper for repr(bytes) and repr(bytearray). */
extern PyObject *_Py_bytes_repr(const char *, Py_ssize_t, int, const char *);
/* Shared __doc__ strings. */
extern const char _Py_isspace__doc__[];
extern const char _Py_isalpha__doc__[];