Commits

Antoine Pitrou committed 5fd3dd1

Fix some outdated doc fragments

  • Participants
  • Parent commits 4872406
  • Branches pep428

Comments (0)

Files changed (1)

 Navigating inside a directory tree::
 
    >>> p = Path('/etc')
-   >>> q = p['init.d/reboot']
+   >>> q = p / 'init.d' / 'reboot'
    >>> q
    PosixPath('/etc/init.d/reboot')
    >>> q.resolve()
    True
    >>> q.is_dir()
    False
-   >>> q.st_mode
-   33261
 
 Opening a file::
 
 Operators
 ^^^^^^^^^
 
-Indexing a path helps create child paths, similarly to ``os.path.join``::
+The slash operator helps create child paths, similarly to ``os.path.join``::
 
    >>> p = PurePath('/etc')
    >>> p
    PurePosixPath('/etc')
-   >>> p['passwd']
-   PurePosixPath('/etc/passwd')
-   >>> p['init.d/apache2']
+   >>> p / 'init.d' / 'apache2'
    PurePosixPath('/etc/init.d/apache2')
+   >>> q = PurePath('bin')
+   >>> '/usr' / q
+   PurePosixPath('/usr/bin')
 
 The string representation of a path is the raw filesystem path itself
 (in native form, e.g. with backslashes under Windows), which you can