[path-PEP] Path inherits from basestring again
Reinhold Birkenfeld
reinhold-birkenfeld-nospam at wolke7.net
Sat Jul 30 12:57:37 EDT 2005
phil hunt wrote:
> On Fri, 29 Jul 2005 14:38:23 +1200, Tony Meyer <t-meyer at ihug.co.nz> wrote:
>>> def functions_which_modifies_some_file_in_place(path):
>>> output = open(path+'.tmp', 'w')
>>> .....
>>>
>>> I dont want a seperator inserted between path and the new extension.
>>
>>Fair enough. Forget using '+' for join, then (which I was never that keen
>>on - TIOWTDI), but I'm still -1 on using '/' for join.
>
> I agree. It's yuck.
So don't use it.
> What's wrong with simply having each path-element as an argument to
> a function, e.g.
>
> join(foo, bar, baz)
Nothing's wrong, and you can do it this way too.
Path(foo, bar, baz) or
Path(foo).joinwith(bar, baz)
Reinhold
More information about the Python-list
mailing list