Commits

Antoine Pitrou  committed 871f4a7

Remove the st_ fields

  • Participants
  • Parent commits e0f4be6
  • Branches pep428

Comments (0)

Files changed (3)

File docs/index.rst

    The owner name and group name of the file, respectively.  :exc:`KeyError`
    is thrown if the file's uid or gid isn't found in the system database.
 
-
-.. data::
-      Path.st_mode
-      Path.st_ino
-      Path.st_dev
-      Path.st_nlink
-      Path.st_uid
-      Path.st_gid
-      Path.st_size
-      Path.st_atime
-      Path.st_mtime
-      Path.st_ctime
-      ...
-
-   Helper attributes returning the corresponding fields on :meth:`Path.stat`'s
-   result::
-
-      >>> p = Path('setup.py')
-      >>> p.st_size
-      956
-      >>> p.st_mtime
-      1327939910.2178059
             if self._closed:
                 self._raise_closed()
 
-    def __getattr__(self, name):
-        if name.startswith('st_'):
-            return getattr(self._stat, name)
-        return self.__getattribute__(name)
-
     def glob(self, pattern):
         """Iterate over this subtree and yield all existing files (of any
         kind, including directories) matching the given pattern.

File test_pathlib.py

         st = p.stat()
         self.assertEqual(st, p.lstat())
 
-    def test_st_fields(self):
-        p = self.cls(BASE) / 'fileA'
-        self.assertEqual(p.st_size, 15)
-        p.st_mtime
-        p.st_mode
-        with self.assertRaises(AttributeError):
-            p.st_foo
-        with self.assertRaises(AttributeError):
-            p.foo
-
     @unittest.skipUnless(pwd, "the pwd module is needed for this test")
     def test_owner(self):
         p = self.cls(BASE) / 'fileA'