Skip to content

Commit dd40fc3

Browse files
Issue #26765: Moved common code and docstrings for bytes and bytearray methods
to bytes_methods.c.
1 parent 045e635 commit dd40fc3

File tree

7 files changed

+519
-777
lines changed

7 files changed

+519
-777
lines changed

Diff for: Include/bytes_methods.h

+21
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ extern void _Py_bytes_title(char *result, const char *s, Py_ssize_t len);
2121
extern void _Py_bytes_capitalize(char *result, const char *s, Py_ssize_t len);
2222
extern void _Py_bytes_swapcase(char *result, const char *s, Py_ssize_t len);
2323

24+
extern PyObject *_Py_bytes_find(const char *str, Py_ssize_t len, PyObject *args);
25+
extern PyObject *_Py_bytes_index(const char *str, Py_ssize_t len, PyObject *args);
26+
extern PyObject *_Py_bytes_rfind(const char *str, Py_ssize_t len, PyObject *args);
27+
extern PyObject *_Py_bytes_rindex(const char *str, Py_ssize_t len, PyObject *args);
28+
extern PyObject *_Py_bytes_count(const char *str, Py_ssize_t len, PyObject *args);
29+
extern int _Py_bytes_contains(const char *str, Py_ssize_t len, PyObject *arg);
30+
extern PyObject *_Py_bytes_startswith(const char *str, Py_ssize_t len, PyObject *args);
31+
extern PyObject *_Py_bytes_endswith(const char *str, Py_ssize_t len, PyObject *args);
32+
2433
/* The maketrans() static method. */
2534
extern PyObject* _Py_bytes_maketrans(Py_buffer *frm, Py_buffer *to);
2635

@@ -37,7 +46,19 @@ extern const char _Py_upper__doc__[];
3746
extern const char _Py_title__doc__[];
3847
extern const char _Py_capitalize__doc__[];
3948
extern const char _Py_swapcase__doc__[];
49+
extern const char _Py_count__doc__[];
50+
extern const char _Py_find__doc__[];
51+
extern const char _Py_index__doc__[];
52+
extern const char _Py_rfind__doc__[];
53+
extern const char _Py_rindex__doc__[];
54+
extern const char _Py_startswith__doc__[];
55+
extern const char _Py_endswith__doc__[];
4056
extern const char _Py_maketrans__doc__[];
57+
extern const char _Py_expandtabs__doc__[];
58+
extern const char _Py_ljust__doc__[];
59+
extern const char _Py_rjust__doc__[];
60+
extern const char _Py_center__doc__[];
61+
extern const char _Py_zfill__doc__[];
4162

4263
/* this is needed because some docs are shared from the .o, not static */
4364
#define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str)

0 commit comments

Comments
 (0)