diff --git a/pep-0428.txt b/pep-0428.txt index 61d82d81c..e0ebf8cbd 100644 --- a/pep-0428.txt +++ b/pep-0428.txt @@ -341,6 +341,15 @@ call ``bytes()`` on it, or use the ``as_bytes()`` method:: >>> bytes(p) b'/home/antoine/pathlib/setup.py' +To represent the path as a ``file`` URI, call the ``as_uri()`` method:: + + >>> p = PurePosixPath('/etc/passwd') + >>> p.as_uri() + 'file:///etc/passwd' + >>> p = PureNTPath('c:/Windows') + >>> p.as_uri() + 'file:///c:/Windows' + Properties ----------