[issue26765] Factor out common bytes and bytearray implementation
Meador Inge
report at bugs.python.org
Sun Apr 17 17:13:45 EDT 2016
Meador Inge added the comment:
If I follow this correctly, then it seems like there are two
main pieces to this patch:
1. Consolidating the following methods into `bytes_methods.c`:
a. {bytes, bytearray}_find_internal
b. {bytes, bytearray}_find
c. {bytes, bytearray}_count
d. {bytes, bytearray}_index
e. {bytes, bytearray}_rfind
f. {bytes, bytearray}_rindex
g. {bytes, bytearray}_contains
h. (_bytes, _bytearray}_tailmatch
i. {bytes, bytearray}_startswith
j. {bytes, bytearray}_endswith
2. Consolidating the redundant implementations of the following functions
into the stringlib:
a. return_self
b. countchar
c. replace_interleave
d. replace_delete_single_character
e. replace_delete_substring
f. replace_single_character_in_place
g. replace_substring_in_place
h. replace_single_character
i. replace_substring
j. replace
If so, then that seems reasonable to me and a nice cleanup.
A few comments:
1. The diffs are fairly large. It might be easier to follow if you stage
the two steps above as separate commits (if possible).
2. Why are some of the namings in stringlib inconsistent? For example,
`stringlib_method_find` and `stringlib_index`. In other words, why
do some names have the *_method_* part?
----------
nosy: +meador.inge
stage: -> patch review
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26765>
_______________________________________
More information about the Python-bugs-list
mailing list