MCPcopy Create free account
hub / github.com/python/mypy / listdir

Method listdir

mypy/test/test_find_sources.py:28–31  ·  view source on GitHub ↗
(self, path: str)

Source from the content-addressed store, hash-verified

26 return any(f.startswith(path) for f in self.files)
27
28 def listdir(self, path: str) -> list[str]:
29 if not path.endswith(os.sep):
30 path += os.sep
31 return list({f[len(path) :].split(os.sep)[0] for f in self.files if f.startswith(path)})
32
33 def init_under_package_root(self, path: str) -> bool:
34 return False

Calls 5

listClass · 0.85
lenFunction · 0.85
splitMethod · 0.80
endswithMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected