Michael Urman wrote:
>>        p = os.path.normpath( os.path.join( __file__, "../..", "lib" ) )
> 
> Shouldn't an example avoid using the path separator directly within a
> string literal?
> 
>    p = path.normpath(path.join(__file__, "..", "..", "lib"))

No need. 'normpath' will automatically convert the forward-slash into a 
backward-slash on Win32 platforms.

More generally: My defacto solution to the problem of path manipulation 
is that the "path algebra" operators are strings, rather than object 
methods or functions. When you join two paths, all of the instructions 
as to how to combine the two paths are contained in the string.

-- Talin

_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to