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

List:       python-dev
Subject:    Re: [Python-Dev] The path module PEP
From:       "Gustavo J. A. M. Carneiro" <gjc () inescporto ! pt>
Date:       2006-01-26 17:22:58
Message-ID: 1138296178.8256.37.camel () localhost
[Download RAW message or body]

On Thu, 2006-01-26 at 16:17 +0100, Fredrik Lundh wrote:
> Gustavo J. A. M. Carneiro wrote:
> 
> > > If a URI class implemented the same methods, it would be something of a
> > > question whether uri.joinpath('/foo/bar', 'baz') would return '/foo/baz'
> > > (and urlparse.urljoin would) or '/foo/bar/baz' (as os.path.join does).
> > > I assume it would be be the latter, and urljoin would be a different
> > > method, maybe something novel like "urljoin".
> >
> >   I honestly don't understand the usefulness of join('/foo/bar', 'baz')
> > ever returning '/foo/baz' instead of '/foo/bar/baz'.  How would the
> > former be of any use?
> 
> it's how URL:s are joined, as noted in the paragraph you replied to
> 
> (a "baz" link on the page "/foo/bar" refers to "/foo/baz", not "/foo/bar/baz")

  That's not how I see it.  A web browser, in order to resolve the link
'baz' in the page '/foo/bar', should do:

	join(basename('/foo/bar'), 'baz')
	== join('/foo', 'baz')
	== '/foo/baz'.

  Regards.

-- 
Gustavo J. A. M. Carneiro
<gjc@inescporto.pt> <gustavo@users.sourceforge.net>
The universe is always one step beyond logic.

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev%40progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread] 

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