Visitar URL original
gh-99726: Add 'fast' argument to os.[l]stat for faster calculation by zooba · Pull Request #99727 · python/cpython · GitHub
Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix tests. Update samestat docs
  • Loading branch information
zooba committed Nov 23, 2022
commit e8670e2538aa67c00ee7f2dd12efcb5e4cae52cd
3 changes: 3 additions & 0 deletions Doc/library/os.path.rst
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ the :mod:`glob` module.)
:func:`os.lstat`, or :func:`os.stat`. This function implements the
underlying comparison used by :func:`samefile` and :func:`sameopenfile`.

Do not use stat results created with the *fast* argument, as they may be
missing information necessary to compare the two files.

.. availability:: Unix, Windows.

.. versionchanged:: 3.4
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ def test_bound_builtin_method(self):
@requires_docstrings
def test_module_level_callable(self):
self.assertEqual(self._get_summary_line(os.stat),
"stat(path, *, dir_fd=None, follow_symlinks=True)")
"stat(path, *, dir_fd=None, follow_symlinks=True, fast=False)")

@requires_docstrings
def test_staticmethod(self):
Expand Down