25 Jan
2014
25 Jan
'14
8:21 p.m.
Instead of str.rreplace you could just add a parameter 'reverse=False|True' and add the same thing wherever needed, including making rfind superfluous.
This is a right way, imo, except that there is no string (/sequence) reversal here, but instead backward traversal.
I suppose a better name could be found. 'traverse_backward=True|False(default)' For some of the reverse methods problems may occur if they operate on an iterator rather than an actual list, tuple, or similar.