A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-November/069800.html below:

[Python-Dev] Path object design

[Python-Dev] Path object design [Python-Dev] Path object designAndrew Dalke dalke at dalkescientific.com
Fri Nov 3 17:58:54 CET 2006
glyph:
> Path manipulation:
>
>  * This is confusing as heck:
>    >>> os.path.join("hello", "/world")
>    '/world'
>    >>> os.path.join("hello", "slash/world")
>    'hello/slash/world'
>    >>> os.path.join("hello", "slash//world")
>    'hello/slash//world'
>    Trying to formulate a general rule for what the arguments to os.path.join
> are supposed to be is really hard.  I can't really figure out what it would
> be like on a non-POSIX/non-win32 platform.

Made trickier by the similar yet different behaviour of urlparse.urljoin.

 >>> import urlparse
 >>> urlparse.urljoin("hello", "/world")
 '/world'
 >>> urlparse.urljoin("hello", "slash/world")
 'slash/world'
 >>> urlparse.urljoin("hello", "slash//world")
 'slash//world'
 >>>

It does not make sense to me that these should be different.

                                               Andrew
                                               dalke at dalkescientific.com

[Apologies to glyph for the dup; mixed up the reply-to.  Still getting
used to gmail.]
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4