space added before printed line from except block
Bjorn Pettersen
BPettersen at NAREX.com
Tue Dec 24 17:27:30 EST 2002
More information about the Python-list mailing list
Tue Dec 24 17:27:30 EST 2002
- Previous message (by thread): space added before printed line from except block
- Next message (by thread): space added before printed line from except block
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> From: Terry Reedy [mailto:tjreedy at udel.edu] > > > On a different note, I'm wondering why str.join > > expects a 'list' as an argument: > >while os.path.join requires separate arguments... Seems rather > >inconsistent? Anyone? > > Hypotheses ;-) > > 1. str.join(alist) was previously string.join(alist, joiner) > so one alist instead of separate args was necessary (joiner > comes after alist since it has default value and alist does > not). 2. Its the inverse of str.split 3. alist is commonly > formed by construction in a loop with alist.append. 4. the > items joined are commonly 'homogeneous' in some sense. > > 1. os.path.join() can be inverse of os.path.split. which > produces tuple that is commonly assigned to separate vars. > 2. joined path components are logically hierarchical rather > that parallel. 3. sequencial construction of a 'joinlist' > would be rare. > > Overall, I suspect the two different interfaces each make > most sense in the different contexts of usage. Ok, I guess I'll buy that for a dollar -- even if it doesn't sound too terribly convincing <wink>. I was just surprised that I noticed such an asymmetry now, after having used both extensively for some time. Hmm.. maybe your conclusion is right after all and they're really two different operations that just happen to share a name... Well, that's more thinking than I wanted to do today. I'll be by the eggnog if anyone needs me <g>. Happy Holidays everyone! -- bjorn
- Previous message (by thread): space added before printed line from except block
- Next message (by thread): space added before printed line from except block
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list