Reversing the order of the return tuple will break the alignment with split/rsplit. Why not just change which of the three strings holds the remainder in the not-found case? In rc1, "d".rpartition(".") --> ('d', '', '') If that changes to "d".rpartition(".") --> ('', '', 'd') then (1) the loop will terminate (2) rpartition will be more parallel to partition (and split), (3) people who used rpartition without looping to termination (and therefore didn't catch the problem) will still be able to use their existing working code. (4) the existing docstring would remain correct, though it could still be improved. (It says "returns S and two empty strings", but doesn't specify the order.) -jJ
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4