[In http://mail.python.org/pipermail/python-dev/2005-August/055880.html ] Andrew Durdin wrote: > one of the "fixed stdlib" examples that Raymond > posted actually uses rpartition and partition in two consecutive lines Even with that leadin, even right next to each other, it took me a bit of time to see the difference between rest.rpartition and rest.partition. > rest, _, query = rest.rpartition('?') > script, _, rest = rest.partition('/') Shortening the names helps, because a single letter matters more. > rest, _, query = rest.rpart('?') > script, _, rest = rest.part('/') A different-looking word (such as Greg's suggestion) might be even better, if the word also works on its own. > rest, _, query = rest.rsplit_at('?') > script, _, rest = rest.split_at('/') -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