args v. *args passed to: os.path.join()
Pierre Fortin
pfortin at pfortin.com
Sat Sep 18 14:59:40 EDT 2004
On Sat, 18 Sep 2004 20:08:35 +0200 Heiko wrote:
> Now, when you call:
>
> os.path.join(["a","b"])
>
> the list ends up in the a parameter, and because the function doesn't
> have to do anything (there are no more arguments), the list is returned
> unchanged (although this should probably raise a TypeError, anyone?).
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ =======
That was the whole point; the rest was pretty much my understanding too...
I can't think of any reason why os.path.join() should ever be presented
anything but strings... on the other hand, maybe it could
check for lists/tuples and use those to return the expected "a/b"...
Then again, I just checked a number of functions in os and os.path;
os.path.join() seems to be the only one which fails to return a
TypeError...
More information about the Python-list
mailing list