summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_bytes_methods.h
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend@python.org>2024-04-03 11:11:14 (GMT)
committerGitHub <noreply@github.com>2024-04-03 11:11:14 (GMT)
commit595bb496b0504429cf01a76fd1ada718d9dd25ca (patch)
treed76ba21373049966c07e901852383fd4a780480e /Include/internal/pycore_bytes_methods.h
parent1dc1521042d5e750b4a129ac8dd439edafed6783 (diff)
downloadcpython-595bb496b0504429cf01a76fd1ada718d9dd25ca.zip
cpython-595bb496b0504429cf01a76fd1ada718d9dd25ca.tar.gz
cpython-595bb496b0504429cf01a76fd1ada718d9dd25ca.tar.bz2
gh-117431: Adapt bytes and bytearray .startswith() and .endswith() to Argument Clinic (#117495)
This change gives a significant speedup, as the METH_FASTCALL calling convention is now used.
Diffstat (limited to 'Include/internal/pycore_bytes_methods.h')
-rw-r--r--Include/internal/pycore_bytes_methods.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/Include/internal/pycore_bytes_methods.h b/Include/internal/pycore_bytes_methods.h
index 11e8ab2..b9c0a4e 100644
--- a/Include/internal/pycore_bytes_methods.h
+++ b/Include/internal/pycore_bytes_methods.h
@@ -32,8 +32,12 @@ extern PyObject *_Py_bytes_rfind(const char *str, Py_ssize_t len, PyObject *args
extern PyObject *_Py_bytes_rindex(const char *str, Py_ssize_t len, PyObject *args);
extern PyObject *_Py_bytes_count(const char *str, Py_ssize_t len, PyObject *args);
extern int _Py_bytes_contains(const char *str, Py_ssize_t len, PyObject *arg);
-extern PyObject *_Py_bytes_startswith(const char *str, Py_ssize_t len, PyObject *args);
-extern PyObject *_Py_bytes_endswith(const char *str, Py_ssize_t len, PyObject *args);
+extern PyObject *_Py_bytes_startswith(const char *str, Py_ssize_t len,
+ PyObject *subobj, Py_ssize_t start,
+ Py_ssize_t end);
+extern PyObject *_Py_bytes_endswith(const char *str, Py_ssize_t len,
+ PyObject *subobj, Py_ssize_t start,
+ Py_ssize_t end);
/* The maketrans() static method. */
extern PyObject* _Py_bytes_maketrans(Py_buffer *frm, Py_buffer *to);