[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
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com