space added before printed line from except block

jerf at compy.attbi.com jerf at compy.attbi.com
Tue Dec 24 19:39:38 EST 2002


On Tue, 24 Dec 2002 11:49:58 +0000, Bjorn Pettersen wrote:
> On a different note, I'm wondering why str.join expects a 'list' as an
> argument:
> 
>>     print "|".join(["Decimal".center(10),
>>                     "Hex".center(10),
>>                     "Current".center(10),
>>                     "Uni Hex".center(10),
>>                     "Uni Char".center(10)])
> 
> while os.path.join requires separate arguments... Seems rather
> inconsistent? Anyone?

Just because they're both named "join" doesn't mean they're doing the same
thing. In fact, they are doing two very different things that happen to
both be best matched by the English word "join". 

You can tell they're doing different things because you can't substitute
one in for the other.

Since they're doing different things, it should be no surprise that they
may work best with two different argument patterns.



More information about the Python-list mailing list