Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
35504897
Commit
35504897
authored
Jul 01, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #26765: Moved wrappers for bytes and bytearray methods to common header
file.
parent
0855e706
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
138 deletions
+77
-138
Objects/bytearrayobject.c
Objects/bytearrayobject.c
+12
-67
Objects/bytesobject.c
Objects/bytesobject.c
+11
-71
Objects/stringlib/transmogrify.h
Objects/stringlib/transmogrify.h
+54
-0
No files found.
Objects/bytearrayobject.c
View file @
35504897
...
@@ -1097,18 +1097,6 @@ bytearray_dealloc(PyByteArrayObject *self)
...
@@ -1097,18 +1097,6 @@ bytearray_dealloc(PyByteArrayObject *self)
#include "stringlib/transmogrify.h"
#include "stringlib/transmogrify.h"
static
PyObject
*
bytearray_find
(
PyByteArrayObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_find
(
PyByteArray_AS_STRING
(
self
),
PyByteArray_GET_SIZE
(
self
),
args
);
}
static
PyObject
*
bytearray_count
(
PyByteArrayObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_count
(
PyByteArray_AS_STRING
(
self
),
PyByteArray_GET_SIZE
(
self
),
args
);
}
/*[clinic input]
/*[clinic input]
bytearray.clear
bytearray.clear
...
@@ -1138,42 +1126,6 @@ bytearray_copy_impl(PyByteArrayObject *self)
...
@@ -1138,42 +1126,6 @@ bytearray_copy_impl(PyByteArrayObject *self)
PyByteArray_GET_SIZE
(
self
));
PyByteArray_GET_SIZE
(
self
));
}
}
static
PyObject
*
bytearray_index
(
PyByteArrayObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_index
(
PyByteArray_AS_STRING
(
self
),
PyByteArray_GET_SIZE
(
self
),
args
);
}
static
PyObject
*
bytearray_rfind
(
PyByteArrayObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_rfind
(
PyByteArray_AS_STRING
(
self
),
PyByteArray_GET_SIZE
(
self
),
args
);
}
static
PyObject
*
bytearray_rindex
(
PyByteArrayObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_rindex
(
PyByteArray_AS_STRING
(
self
),
PyByteArray_GET_SIZE
(
self
),
args
);
}
static
int
bytearray_contains
(
PyObject
*
self
,
PyObject
*
arg
)
{
return
_Py_bytes_contains
(
PyByteArray_AS_STRING
(
self
),
PyByteArray_GET_SIZE
(
self
),
arg
);
}
static
PyObject
*
bytearray_startswith
(
PyByteArrayObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_startswith
(
PyByteArray_AS_STRING
(
self
),
PyByteArray_GET_SIZE
(
self
),
args
);
}
static
PyObject
*
bytearray_endswith
(
PyByteArrayObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_endswith
(
PyByteArray_AS_STRING
(
self
),
PyByteArray_GET_SIZE
(
self
),
args
);
}
/*[clinic input]
/*[clinic input]
bytearray.translate
bytearray.translate
...
@@ -1329,8 +1281,8 @@ bytearray_replace_impl(PyByteArrayObject *self, Py_buffer *old,
...
@@ -1329,8 +1281,8 @@ bytearray_replace_impl(PyByteArrayObject *self, Py_buffer *old,
/*[clinic end generated code: output=d39884c4dc59412a input=aa379d988637c7fb]*/
/*[clinic end generated code: output=d39884c4dc59412a input=aa379d988637c7fb]*/
{
{
return
stringlib_replace
((
PyObject
*
)
self
,
return
stringlib_replace
((
PyObject
*
)
self
,
(
const
char
*
)
old
->
buf
,
old
->
len
,
old
->
buf
,
old
->
len
,
(
const
char
*
)
new
->
buf
,
new
->
len
,
count
);
new
->
buf
,
new
->
len
,
count
);
}
}
/*[clinic input]
/*[clinic input]
...
@@ -1995,14 +1947,6 @@ PyDoc_STRVAR(hex__doc__,
...
@@ -1995,14 +1947,6 @@ PyDoc_STRVAR(hex__doc__,
Create a string of hexadecimal numbers from a bytearray object.
\n
\
Create a string of hexadecimal numbers from a bytearray object.
\n
\
Example: bytearray([0xb9, 0x01, 0xef]).hex() -> 'b901ef'."
);
Example: bytearray([0xb9, 0x01, 0xef]).hex() -> 'b901ef'."
);
static
PyObject
*
bytearray_hex
(
PyBytesObject
*
self
)
{
char
*
argbuf
=
PyByteArray_AS_STRING
(
self
);
Py_ssize_t
arglen
=
PyByteArray_GET_SIZE
(
self
);
return
_Py_strhex
(
argbuf
,
arglen
);
}
static
PyObject
*
static
PyObject
*
_common_reduce
(
PyByteArrayObject
*
self
,
int
proto
)
_common_reduce
(
PyByteArrayObject
*
self
,
int
proto
)
{
{
...
@@ -2091,7 +2035,7 @@ static PySequenceMethods bytearray_as_sequence = {
...
@@ -2091,7 +2035,7 @@ static PySequenceMethods bytearray_as_sequence = {
0
,
/* sq_slice */
0
,
/* sq_slice */
(
ssizeobjargproc
)
bytearray_setitem
,
/* sq_ass_item */
(
ssizeobjargproc
)
bytearray_setitem
,
/* sq_ass_item */
0
,
/* sq_ass_slice */
0
,
/* sq_ass_slice */
(
objobjproc
)
bytearray
_contains
,
/* sq_contains */
(
objobjproc
)
stringlib
_contains
,
/* sq_contains */
(
binaryfunc
)
bytearray_iconcat
,
/* sq_inplace_concat */
(
binaryfunc
)
bytearray_iconcat
,
/* sq_inplace_concat */
(
ssizeargfunc
)
bytearray_irepeat
,
/* sq_inplace_repeat */
(
ssizeargfunc
)
bytearray_irepeat
,
/* sq_inplace_repeat */
};
};
...
@@ -2119,19 +2063,19 @@ bytearray_methods[] = {
...
@@ -2119,19 +2063,19 @@ bytearray_methods[] = {
{
"center"
,
(
PyCFunction
)
stringlib_center
,
METH_VARARGS
,
_Py_center__doc__
},
{
"center"
,
(
PyCFunction
)
stringlib_center
,
METH_VARARGS
,
_Py_center__doc__
},
BYTEARRAY_CLEAR_METHODDEF
BYTEARRAY_CLEAR_METHODDEF
BYTEARRAY_COPY_METHODDEF
BYTEARRAY_COPY_METHODDEF
{
"count"
,
(
PyCFunction
)
bytearray
_count
,
METH_VARARGS
,
{
"count"
,
(
PyCFunction
)
stringlib_method
_count
,
METH_VARARGS
,
_Py_count__doc__
},
_Py_count__doc__
},
BYTEARRAY_DECODE_METHODDEF
BYTEARRAY_DECODE_METHODDEF
{
"endswith"
,
(
PyCFunction
)
bytearray
_endswith
,
METH_VARARGS
,
{
"endswith"
,
(
PyCFunction
)
stringlib
_endswith
,
METH_VARARGS
,
_Py_endswith__doc__
},
_Py_endswith__doc__
},
{
"expandtabs"
,
(
PyCFunction
)
stringlib_expandtabs
,
METH_VARARGS
|
METH_KEYWORDS
,
{
"expandtabs"
,
(
PyCFunction
)
stringlib_expandtabs
,
METH_VARARGS
|
METH_KEYWORDS
,
_Py_expandtabs__doc__
},
_Py_expandtabs__doc__
},
BYTEARRAY_EXTEND_METHODDEF
BYTEARRAY_EXTEND_METHODDEF
{
"find"
,
(
PyCFunction
)
bytearray
_find
,
METH_VARARGS
,
{
"find"
,
(
PyCFunction
)
stringlib_method
_find
,
METH_VARARGS
,
_Py_find__doc__
},
_Py_find__doc__
},
BYTEARRAY_FROMHEX_METHODDEF
BYTEARRAY_FROMHEX_METHODDEF
{
"hex"
,
(
PyCFunction
)
bytearray
_hex
,
METH_NOARGS
,
hex__doc__
},
{
"hex"
,
(
PyCFunction
)
stringlib
_hex
,
METH_NOARGS
,
hex__doc__
},
{
"index"
,
(
PyCFunction
)
bytearray
_index
,
METH_VARARGS
,
_Py_index__doc__
},
{
"index"
,
(
PyCFunction
)
stringlib
_index
,
METH_VARARGS
,
_Py_index__doc__
},
BYTEARRAY_INSERT_METHODDEF
BYTEARRAY_INSERT_METHODDEF
{
"isalnum"
,
(
PyCFunction
)
stringlib_isalnum
,
METH_NOARGS
,
{
"isalnum"
,
(
PyCFunction
)
stringlib_isalnum
,
METH_NOARGS
,
_Py_isalnum__doc__
},
_Py_isalnum__doc__
},
...
@@ -2157,15 +2101,16 @@ bytearray_methods[] = {
...
@@ -2157,15 +2101,16 @@ bytearray_methods[] = {
BYTEARRAY_REMOVE_METHODDEF
BYTEARRAY_REMOVE_METHODDEF
BYTEARRAY_REPLACE_METHODDEF
BYTEARRAY_REPLACE_METHODDEF
BYTEARRAY_REVERSE_METHODDEF
BYTEARRAY_REVERSE_METHODDEF
{
"rfind"
,
(
PyCFunction
)
bytearray_rfind
,
METH_VARARGS
,
_Py_rfind__doc__
},
{
"rfind"
,
(
PyCFunction
)
stringlib_method_rfind
,
METH_VARARGS
,
{
"rindex"
,
(
PyCFunction
)
bytearray_rindex
,
METH_VARARGS
,
_Py_rindex__doc__
},
_Py_rfind__doc__
},
{
"rindex"
,
(
PyCFunction
)
stringlib_rindex
,
METH_VARARGS
,
_Py_rindex__doc__
},
{
"rjust"
,
(
PyCFunction
)
stringlib_rjust
,
METH_VARARGS
,
_Py_rjust__doc__
},
{
"rjust"
,
(
PyCFunction
)
stringlib_rjust
,
METH_VARARGS
,
_Py_rjust__doc__
},
BYTEARRAY_RPARTITION_METHODDEF
BYTEARRAY_RPARTITION_METHODDEF
BYTEARRAY_RSPLIT_METHODDEF
BYTEARRAY_RSPLIT_METHODDEF
BYTEARRAY_RSTRIP_METHODDEF
BYTEARRAY_RSTRIP_METHODDEF
BYTEARRAY_SPLIT_METHODDEF
BYTEARRAY_SPLIT_METHODDEF
BYTEARRAY_SPLITLINES_METHODDEF
BYTEARRAY_SPLITLINES_METHODDEF
{
"startswith"
,
(
PyCFunction
)
bytearray_startswith
,
METH_VARARGS
,
{
"startswith"
,
(
PyCFunction
)
stringlib_startswith
,
METH_VARARGS
,
_Py_startswith__doc__
},
_Py_startswith__doc__
},
BYTEARRAY_STRIP_METHODDEF
BYTEARRAY_STRIP_METHODDEF
{
"swapcase"
,
(
PyCFunction
)
stringlib_swapcase
,
METH_NOARGS
,
{
"swapcase"
,
(
PyCFunction
)
stringlib_swapcase
,
METH_NOARGS
,
...
...
Objects/bytesobject.c
View file @
35504897
...
@@ -1485,12 +1485,6 @@ bytes_repeat(PyBytesObject *a, Py_ssize_t n)
...
@@ -1485,12 +1485,6 @@ bytes_repeat(PyBytesObject *a, Py_ssize_t n)
return
(
PyObject
*
)
op
;
return
(
PyObject
*
)
op
;
}
}
static
int
bytes_contains
(
PyObject
*
self
,
PyObject
*
arg
)
{
return
_Py_bytes_contains
(
PyBytes_AS_STRING
(
self
),
PyBytes_GET_SIZE
(
self
),
arg
);
}
static
PyObject
*
static
PyObject
*
bytes_item
(
PyBytesObject
*
a
,
Py_ssize_t
i
)
bytes_item
(
PyBytesObject
*
a
,
Py_ssize_t
i
)
{
{
...
@@ -1701,7 +1695,7 @@ static PySequenceMethods bytes_as_sequence = {
...
@@ -1701,7 +1695,7 @@ static PySequenceMethods bytes_as_sequence = {
0
,
/*sq_slice*/
0
,
/*sq_slice*/
0
,
/*sq_ass_item*/
0
,
/*sq_ass_item*/
0
,
/*sq_ass_slice*/
0
,
/*sq_ass_slice*/
(
objobjproc
)
bytes
_contains
/*sq_contains*/
(
objobjproc
)
stringlib
_contains
/*sq_contains*/
};
};
static
PyMappingMethods
bytes_as_mapping
=
{
static
PyMappingMethods
bytes_as_mapping
=
{
...
@@ -1873,32 +1867,6 @@ _PyBytes_Join(PyObject *sep, PyObject *x)
...
@@ -1873,32 +1867,6 @@ _PyBytes_Join(PyObject *sep, PyObject *x)
return
bytes_join
((
PyBytesObject
*
)
sep
,
x
);
return
bytes_join
((
PyBytesObject
*
)
sep
,
x
);
}
}
static
PyObject
*
bytes_find
(
PyBytesObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_find
(
PyBytes_AS_STRING
(
self
),
PyBytes_GET_SIZE
(
self
),
args
);
}
static
PyObject
*
bytes_index
(
PyBytesObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_index
(
PyBytes_AS_STRING
(
self
),
PyBytes_GET_SIZE
(
self
),
args
);
}
static
PyObject
*
bytes_rfind
(
PyBytesObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_rfind
(
PyBytes_AS_STRING
(
self
),
PyBytes_GET_SIZE
(
self
),
args
);
}
static
PyObject
*
bytes_rindex
(
PyBytesObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_rindex
(
PyBytes_AS_STRING
(
self
),
PyBytes_GET_SIZE
(
self
),
args
);
}
Py_LOCAL_INLINE
(
PyObject
*
)
Py_LOCAL_INLINE
(
PyObject
*
)
do_xstrip
(
PyBytesObject
*
self
,
int
striptype
,
PyObject
*
sepobj
)
do_xstrip
(
PyBytesObject
*
self
,
int
striptype
,
PyObject
*
sepobj
)
...
@@ -2035,13 +2003,6 @@ bytes_rstrip_impl(PyBytesObject *self, PyObject *bytes)
...
@@ -2035,13 +2003,6 @@ bytes_rstrip_impl(PyBytesObject *self, PyObject *bytes)
}
}
static
PyObject
*
bytes_count
(
PyBytesObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_count
(
PyBytes_AS_STRING
(
self
),
PyBytes_GET_SIZE
(
self
),
args
);
}
/*[clinic input]
/*[clinic input]
bytes.translate
bytes.translate
...
@@ -2228,19 +2189,6 @@ bytes_replace_impl(PyBytesObject *self, Py_buffer *old, Py_buffer *new,
...
@@ -2228,19 +2189,6 @@ bytes_replace_impl(PyBytesObject *self, Py_buffer *old, Py_buffer *new,
/** End DALKE **/
/** End DALKE **/
static
PyObject
*
bytes_startswith
(
PyBytesObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_startswith
(
PyBytes_AS_STRING
(
self
),
PyBytes_GET_SIZE
(
self
),
args
);
}
static
PyObject
*
bytes_endswith
(
PyBytesObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_endswith
(
PyBytes_AS_STRING
(
self
),
PyBytes_GET_SIZE
(
self
),
args
);
}
/*[clinic input]
/*[clinic input]
bytes.decode
bytes.decode
...
@@ -2394,14 +2342,6 @@ PyDoc_STRVAR(hex__doc__,
...
@@ -2394,14 +2342,6 @@ PyDoc_STRVAR(hex__doc__,
Create a string of hexadecimal numbers from a bytes object.
\n
\
Create a string of hexadecimal numbers from a bytes object.
\n
\
Example: b'
\\
xb9
\\
x01
\\
xef'.hex() -> 'b901ef'."
);
Example: b'
\\
xb9
\\
x01
\\
xef'.hex() -> 'b901ef'."
);
static
PyObject
*
bytes_hex
(
PyBytesObject
*
self
)
{
char
*
argbuf
=
PyBytes_AS_STRING
(
self
);
Py_ssize_t
arglen
=
PyBytes_GET_SIZE
(
self
);
return
_Py_strhex
(
argbuf
,
arglen
);
}
static
PyObject
*
static
PyObject
*
bytes_getnewargs
(
PyBytesObject
*
v
)
bytes_getnewargs
(
PyBytesObject
*
v
)
{
{
...
@@ -2414,20 +2354,19 @@ bytes_methods[] = {
...
@@ -2414,20 +2354,19 @@ bytes_methods[] = {
{
"__getnewargs__"
,
(
PyCFunction
)
bytes_getnewargs
,
METH_NOARGS
},
{
"__getnewargs__"
,
(
PyCFunction
)
bytes_getnewargs
,
METH_NOARGS
},
{
"capitalize"
,
(
PyCFunction
)
stringlib_capitalize
,
METH_NOARGS
,
{
"capitalize"
,
(
PyCFunction
)
stringlib_capitalize
,
METH_NOARGS
,
_Py_capitalize__doc__
},
_Py_capitalize__doc__
},
{
"center"
,
(
PyCFunction
)
stringlib_center
,
METH_VARARGS
,
{
"center"
,
(
PyCFunction
)
stringlib_center
,
METH_VARARGS
,
_Py_center__doc__
},
_Py_center__doc__
},
{
"count"
,
(
PyCFunction
)
stringlib_method_count
,
METH_VARARGS
,
{
"count"
,
(
PyCFunction
)
bytes_count
,
METH_VARARGS
,
_Py_count__doc__
},
_Py_count__doc__
},
BYTES_DECODE_METHODDEF
BYTES_DECODE_METHODDEF
{
"endswith"
,
(
PyCFunction
)
bytes
_endswith
,
METH_VARARGS
,
{
"endswith"
,
(
PyCFunction
)
stringlib
_endswith
,
METH_VARARGS
,
_Py_endswith__doc__
},
_Py_endswith__doc__
},
{
"expandtabs"
,
(
PyCFunction
)
stringlib_expandtabs
,
METH_VARARGS
|
METH_KEYWORDS
,
{
"expandtabs"
,
(
PyCFunction
)
stringlib_expandtabs
,
METH_VARARGS
|
METH_KEYWORDS
,
_Py_expandtabs__doc__
},
_Py_expandtabs__doc__
},
{
"find"
,
(
PyCFunction
)
bytes
_find
,
METH_VARARGS
,
{
"find"
,
(
PyCFunction
)
stringlib_method
_find
,
METH_VARARGS
,
_Py_find__doc__
},
_Py_find__doc__
},
BYTES_FROMHEX_METHODDEF
BYTES_FROMHEX_METHODDEF
{
"hex"
,
(
PyCFunction
)
bytes
_hex
,
METH_NOARGS
,
hex__doc__
},
{
"hex"
,
(
PyCFunction
)
stringlib
_hex
,
METH_NOARGS
,
hex__doc__
},
{
"index"
,
(
PyCFunction
)
bytes
_index
,
METH_VARARGS
,
_Py_index__doc__
},
{
"index"
,
(
PyCFunction
)
stringlib
_index
,
METH_VARARGS
,
_Py_index__doc__
},
{
"isalnum"
,
(
PyCFunction
)
stringlib_isalnum
,
METH_NOARGS
,
{
"isalnum"
,
(
PyCFunction
)
stringlib_isalnum
,
METH_NOARGS
,
_Py_isalnum__doc__
},
_Py_isalnum__doc__
},
{
"isalpha"
,
(
PyCFunction
)
stringlib_isalpha
,
METH_NOARGS
,
{
"isalpha"
,
(
PyCFunction
)
stringlib_isalpha
,
METH_NOARGS
,
...
@@ -2449,15 +2388,16 @@ bytes_methods[] = {
...
@@ -2449,15 +2388,16 @@ bytes_methods[] = {
BYTES_MAKETRANS_METHODDEF
BYTES_MAKETRANS_METHODDEF
BYTES_PARTITION_METHODDEF
BYTES_PARTITION_METHODDEF
BYTES_REPLACE_METHODDEF
BYTES_REPLACE_METHODDEF
{
"rfind"
,
(
PyCFunction
)
bytes_rfind
,
METH_VARARGS
,
_Py_rfind__doc__
},
{
"rfind"
,
(
PyCFunction
)
stringlib_method_rfind
,
METH_VARARGS
,
{
"rindex"
,
(
PyCFunction
)
bytes_rindex
,
METH_VARARGS
,
_Py_rindex__doc__
},
_Py_rfind__doc__
},
{
"rindex"
,
(
PyCFunction
)
stringlib_rindex
,
METH_VARARGS
,
_Py_rindex__doc__
},
{
"rjust"
,
(
PyCFunction
)
stringlib_rjust
,
METH_VARARGS
,
_Py_rjust__doc__
},
{
"rjust"
,
(
PyCFunction
)
stringlib_rjust
,
METH_VARARGS
,
_Py_rjust__doc__
},
BYTES_RPARTITION_METHODDEF
BYTES_RPARTITION_METHODDEF
BYTES_RSPLIT_METHODDEF
BYTES_RSPLIT_METHODDEF
BYTES_RSTRIP_METHODDEF
BYTES_RSTRIP_METHODDEF
BYTES_SPLIT_METHODDEF
BYTES_SPLIT_METHODDEF
BYTES_SPLITLINES_METHODDEF
BYTES_SPLITLINES_METHODDEF
{
"startswith"
,
(
PyCFunction
)
bytes
_startswith
,
METH_VARARGS
,
{
"startswith"
,
(
PyCFunction
)
stringlib
_startswith
,
METH_VARARGS
,
_Py_startswith__doc__
},
_Py_startswith__doc__
},
BYTES_STRIP_METHODDEF
BYTES_STRIP_METHODDEF
{
"swapcase"
,
(
PyCFunction
)
stringlib_swapcase
,
METH_NOARGS
,
{
"swapcase"
,
(
PyCFunction
)
stringlib_swapcase
,
METH_NOARGS
,
...
...
Objects/stringlib/transmogrify.h
View file @
35504897
...
@@ -2,6 +2,60 @@
...
@@ -2,6 +2,60 @@
# error "transmogrify.h only compatible with byte-wise strings"
# error "transmogrify.h only compatible with byte-wise strings"
#endif
#endif
Py_LOCAL
(
PyObject
*
)
stringlib_method_find
(
PyObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_find
(
STRINGLIB_STR
(
self
),
STRINGLIB_LEN
(
self
),
args
);
}
Py_LOCAL
(
PyObject
*
)
stringlib_index
(
PyObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_index
(
STRINGLIB_STR
(
self
),
STRINGLIB_LEN
(
self
),
args
);
}
Py_LOCAL
(
PyObject
*
)
stringlib_method_rfind
(
PyObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_rfind
(
STRINGLIB_STR
(
self
),
STRINGLIB_LEN
(
self
),
args
);
}
Py_LOCAL
(
PyObject
*
)
stringlib_rindex
(
PyObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_rindex
(
STRINGLIB_STR
(
self
),
STRINGLIB_LEN
(
self
),
args
);
}
Py_LOCAL
(
PyObject
*
)
stringlib_method_count
(
PyObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_count
(
STRINGLIB_STR
(
self
),
STRINGLIB_LEN
(
self
),
args
);
}
Py_LOCAL
(
int
)
stringlib_contains
(
PyObject
*
self
,
PyObject
*
arg
)
{
return
_Py_bytes_contains
(
STRINGLIB_STR
(
self
),
STRINGLIB_LEN
(
self
),
arg
);
}
Py_LOCAL
(
PyObject
*
)
stringlib_startswith
(
PyObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_startswith
(
STRINGLIB_STR
(
self
),
STRINGLIB_LEN
(
self
),
args
);
}
Py_LOCAL
(
PyObject
*
)
stringlib_endswith
(
PyObject
*
self
,
PyObject
*
args
)
{
return
_Py_bytes_endswith
(
STRINGLIB_STR
(
self
),
STRINGLIB_LEN
(
self
),
args
);
}
Py_LOCAL
(
PyObject
*
)
stringlib_hex
(
PyObject
*
self
)
{
return
_Py_strhex
(
STRINGLIB_STR
(
self
),
STRINGLIB_LEN
(
self
));
}
/* the more complicated methods. parts of these should be pulled out into the
/* the more complicated methods. parts of these should be pulled out into the
shared code in bytes_methods.c to cut down on duplicate code bloat. */
shared code in bytes_methods.c to cut down on duplicate code bloat. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment