Carl Banks wrote:

> It's not even fullproof on Unix.
> 
> '/home//h1122/bin///ghi/'.split('/')
> 
> ['','home','','bin','','','ghi','']


What? No. Absolutely not -- that would be a major bug. Did you actually try
it?

>>> '/home//h1122/bin///ghi/'.split('/')
['', 'home', '', 'h1122', 'bin', '', '', 'ghi', '']

Exactly as expected, and correct.

Now obviously if you intend treating this as a list of path components, you
have to filter out the empty strings, but otherwise works fine.



-- 
Steven

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to