This post originated from an RSS feed registered with Python Buzz
by Ian Bicking.
Original Post: Python nit, chapter 1
Feed Title: Ian Bicking
Feed URL: http://www.ianbicking.org/feeds/atom.xml
Feed Description: Thoughts on Python and Programming.
I like Python. But there are little things that aren't quite right to me. In this extended series I will gripe about them.
First up, string.join (or str.join as we should now call it). We all know the basic gripe, this looks funny:
>>> sep = '\n'
>>> doc = sep.join(lines)
It should be:
>>> doc = join(lines, sep)
But I realized the realproblem is about typography as much as the order of the arguments. Because most of the time when I'm joining things, I'm doing it like:
>>> doc = '\n'.join(sep)
The ' doesn't line up with the .join at all. Other string methods aren't a problem, because you never call them on string literals (except maybe split, but then only to save a few keystrokes).
I can understand why Guido didn't want to add a join method to sequencees. And some people do tend to panic when they consider more builtins (mostly purists who like the idea of a small language). Anyway, it's still a gripe for me.