For review: PEP 308 - If-then-else expression

Roy Smith roy at panix.com
Sun Feb 9 17:20:41 EST 2003


I wrote:
>> I'm with Aahz.  I think it's pretty silly.  Join() should have been a 
>> method of lists (and maybe tuples?), not of strings.

aahz at pythoncraft.com (Aahz) wrote:
> Well, no, that doesn't work, either.  join() should have been a class
> method rather than an instance method, is what it is.

I don't follow.  What's an "instance method" as opposed to a "class 
method"?  What I was trying to say is that I think instead of:

>>> breakfastItems = ['spam', 'eggs', 'spam', 'spam', 'spam', 'and spam']
>>> ', '.join (breakfastItems)
'spam, eggs, spam, spam, spam, and spam'

it should have been:
breakfastItems.join (', ')




More information about the Python-list mailing list