[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: [path-PEP] Path inherits from basestring again
From:       Ron Adam <rrr () ronadam ! com>
Date:       2005-07-27 18:18:07
Message-ID: zdQFe.21120$iG6.7581 () tornado ! tampabay ! rr ! com
[Download RAW message or body]

Toby Dickenson wrote:
> On Wednesday 27 July 2005 05:37, Meyer, Tony wrote:
> 
> 
>>I can see that this would make sense in some situations, but ISTM that it
>>would make a great deal more sense (and be much more intuitive) to have
>>concatenation include the separator character (i.e. be join).  
> 
> 
> 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.

My impression of '+', is it always join like objects...

    str+str -> str
    list+list -> list
    tuple+tuple -> tuple

So ...

    path+path -> path

In all current cases, (that I know of), of differing types, '+' raises 
an error.

Question:  Is a path object mutable?

Would the += operator create an new object or modify the original?

    p = path('C://somedir//somefile')

    p+='.zip'          what would this do?

    p[-1]+='.zip'      Or this?


Cheer's Ron.
-- 
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic