MCPcopy Index your code
hub / github.com/RustPython/RustPython / iterdir

Method iterdir

Lib/pathlib/__init__.py:829–841  ·  view source on GitHub ↗

Yield path objects of the directory contents. The children are yielded in arbitrary order, and the special entries '.' and '..' are not included.

(self)

Source from the content-addressed store, hash-verified

827 return path
828
829 def iterdir(self):
830 """Yield path objects of the directory contents.
831
832 The children are yielded in arbitrary order, and the
833 special entries '.' and '..' are not included.
834 """
835 root_dir = str(self)
836 with os.scandir(root_dir) as scandir_it:
837 entries = list(scandir_it)
838 if root_dir == '.':
839 return (self._from_dir_entry(e, e.name) for e in entries)
840 else:
841 return (self._from_dir_entry(e, e.path) for e in entries)
842
843 def glob(self, pattern, *, case_sensitive=None, recurse_symlinks=False):
844 """Iterate over this subtree and yield all existing files (of any

Callers 15

test_iterdir_on_fileMethod · 0.95
test_openMethod · 0.95
test_readMethod · 0.95
test_mutabilityMethod · 0.95
test_malformed_pathsMethod · 0.95
get_original_filesFunction · 0.95

Calls 4

_from_dir_entryMethod · 0.95
strFunction · 0.85
listClass · 0.85
scandirMethod · 0.45

Tested by 11

test_iterdir_on_fileMethod · 0.76
test_openMethod · 0.76
test_readMethod · 0.76
test_mutabilityMethod · 0.76
test_malformed_pathsMethod · 0.76