Lines Matching refs:self
1489 bytes_contains(PyObject *self, PyObject *arg)
1491 return _Py_bytes_contains(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), arg);
1596 bytes_subscript(PyBytesObject* self, PyObject* item)
1603 i += PyBytes_GET_SIZE(self);
1604 if (i < 0 || i >= PyBytes_GET_SIZE(self)) {
1609 return _PyLong_FromUnsignedChar((unsigned char)self->ob_sval[i]);
1621 slicelength = PySlice_AdjustIndices(PyBytes_GET_SIZE(self), &start,
1628 slicelength == PyBytes_GET_SIZE(self) &&
1629 PyBytes_CheckExact(self)) {
1630 Py_INCREF(self);
1631 return (PyObject *)self;
1635 PyBytes_AS_STRING(self) + start,
1639 source_buf = PyBytes_AS_STRING(self);
1662 bytes_buffer_getbuffer(PyBytesObject *self, Py_buffer *view, int flags)
1664 return PyBuffer_FillInfo(view, (PyObject*)self, (void *)self->ob_sval, Py_SIZE(self),
1697 bytes___bytes___impl(PyBytesObject *self)
1700 if (PyBytes_CheckExact(self)) {
1701 Py_INCREF(self);
1702 return (PyObject *)self;
1705 return PyBytes_FromStringAndSize(self->ob_sval, Py_SIZE(self));
1729 bytes_split_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit)
1732 Py_ssize_t len = PyBytes_GET_SIZE(self), n;
1733 const char *s = PyBytes_AS_STRING(self), *sub;
1740 return stringlib_split_whitespace((PyObject*) self, s, len, maxsplit);
1746 list = stringlib_split((PyObject*) self, s, len, sub, n, maxsplit);
1768 bytes_partition_impl(PyBytesObject *self, Py_buffer *sep)
1772 (PyObject*) self,
1773 PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self),
1795 bytes_rpartition_impl(PyBytesObject *self, Py_buffer *sep)
1799 (PyObject*) self,
1800 PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self),
1814 bytes_rsplit_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit)
1817 Py_ssize_t len = PyBytes_GET_SIZE(self), n;
1818 const char *s = PyBytes_AS_STRING(self), *sub;
1825 return stringlib_rsplit_whitespace((PyObject*) self, s, len, maxsplit);
1831 list = stringlib_rsplit((PyObject*) self, s, len, sub, n, maxsplit);
1853 bytes_join(PyBytesObject *self, PyObject *iterable_of_bytes)
1856 return stringlib_bytes_join((PyObject*)self, iterable_of_bytes);
1868 bytes_find(PyBytesObject *self, PyObject *args)
1870 return _Py_bytes_find(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args);
1874 bytes_index(PyBytesObject *self, PyObject *args)
1876 return _Py_bytes_index(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args);
1881 bytes_rfind(PyBytesObject *self, PyObject *args)
1883 return _Py_bytes_rfind(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args);
1888 bytes_rindex(PyBytesObject *self, PyObject *args)
1890 return _Py_bytes_rindex(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args);
1895 do_xstrip(PyBytesObject *self, int striptype, PyObject *sepobj)
1898 const char *s = PyBytes_AS_STRING(self);
1899 Py_ssize_t len = PyBytes_GET_SIZE(self);
1926 if (i == 0 && j == len && PyBytes_CheckExact(self)) {
1927 Py_INCREF(self);
1928 return (PyObject*)self;
1936 do_strip(PyBytesObject *self, int striptype)
1938 const char *s = PyBytes_AS_STRING(self);
1939 Py_ssize_t len = PyBytes_GET_SIZE(self), i, j;
1956 if (i == 0 && j == len && PyBytes_CheckExact(self)) {
1957 Py_INCREF(self);
1958 return (PyObject*)self;
1966 do_argstrip(PyBytesObject *self, int striptype, PyObject *bytes)
1969 return do_xstrip(self, striptype, bytes);
1971 return do_strip(self, striptype);
1986 bytes_strip_impl(PyBytesObject *self, PyObject *bytes)
1989 return do_argstrip(self, BOTHSTRIP, bytes);
2004 bytes_lstrip_impl(PyBytesObject *self, PyObject *bytes)
2007 return do_argstrip(self, LEFTSTRIP, bytes);
2022 bytes_rstrip_impl(PyBytesObject *self, PyObject *bytes)
2025 return do_argstrip(self, RIGHTSTRIP, bytes);
2030 bytes_count(PyBytesObject *self, PyObject *args)
2032 return _Py_bytes_count(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args);
2051 bytes_translate_impl(PyBytesObject *self, PyObject *table,
2061 PyObject *input_obj = (PyObject*)self;
2209 bytes_replace_impl(PyBytesObject *self, Py_buffer *old, Py_buffer *new,
2213 return stringlib_replace((PyObject *)self,
2233 bytes_removeprefix_impl(PyBytesObject *self, Py_buffer *prefix)
2236 const char *self_start = PyBytes_AS_STRING(self);
2237 Py_ssize_t self_len = PyBytes_GET_SIZE(self);
2249 if (PyBytes_CheckExact(self)) {
2250 Py_INCREF(self);
2251 return (PyObject *)self;
2271 bytes_removesuffix_impl(PyBytesObject *self, Py_buffer *suffix)
2274 const char *self_start = PyBytes_AS_STRING(self);
2275 Py_ssize_t self_len = PyBytes_GET_SIZE(self);
2288 if (PyBytes_CheckExact(self)) {
2289 Py_INCREF(self);
2290 return (PyObject *)self;
2297 bytes_startswith(PyBytesObject *self, PyObject *args)
2299 return _Py_bytes_startswith(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args);
2303 bytes_endswith(PyBytesObject *self, PyObject *args)
2305 return _Py_bytes_endswith(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args);
2325 bytes_decode_impl(PyBytesObject *self, const char *encoding,
2329 return PyUnicode_FromEncodedObject((PyObject*)self, encoding, errors);
2345 bytes_splitlines_impl(PyBytesObject *self, int keepends)
2349 (PyObject*) self, PyBytes_AS_STRING(self),
2350 PyBytes_GET_SIZE(self), keepends
2479 bytes_hex_impl(PyBytesObject *self, PyObject *sep, int bytes_per_sep)
2482 const char *argbuf = PyBytes_AS_STRING(self);
2483 Py_ssize_t arglen = PyBytes_GET_SIZE(self);
2558 bytes_mod(PyObject *self, PyObject *arg)
2560 if (!PyBytes_Check(self)) {
2563 return _PyBytes_FormatEx(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self),
2887 bytes_alloc(PyTypeObject *self, Py_ssize_t nitems)
2889 PyBytesObject *obj = (PyBytesObject*)PyType_GenericAlloc(self, nitems);