Summary
Remove codepoint_slices_reversed in favor of composing reversed() on the result of codepoint_slices().
Motivation
- API Reduction: Removes specialized “reversed” methods from the main String/Slice API in favor of composable iterator objects.
- Pythonic Consistency: Aligns with Python’s philosophy where iterators/objects handle their own traversal logic (forward or backward) rather than functions.
Proposed Changes - Update CodepointSliceIter: Ensure this struct implements
__reversed__. - Deprecate Method: Mark
codepoint_slices_reversedas deprecated or remove it entirely.
Usage Comparison
Current (Deprecated):
for s in str.codepoint_slices_reversed():
print(s)
Proposed:
for s in reversed(str.codepoint_slices()):
print(s)