11.4 Paths

One component that deserves special attention is the path. It is possible to build and work with paths indepently from URI objects:

    >>> from itools.uri import Path
    >>>
    >>> path = Path('/a/b/c')
    >>> for name in path:
    ...     print name
    ... 
    a
    b
    c

As this example shows paths are iterable. Also, paths may be absolute or relative, and they can be resolved very much the same way as URI objects:

    >>> p2 = '../d/e'
    >>> print path.resolve(p2)
    /a/d/e