MCPcopy Index your code
hub / github.com/python/cpython / contents

Function contents

Lib/importlib/resources/_functional.py:48–60  ·  view source on GitHub ↗

Return an iterable over the named resources within the package. The iterable returns :class:`str` resources (e.g. files). The iterable does not recurse into subdirectories.

(anchor, *path_names)

Source from the content-addressed store, hash-verified

46
47
48def contents(anchor, *path_names):
49 """Return an iterable over the named resources within the package.
50
51 The iterable returns :class:`str` resources (e.g. files).
52 The iterable does not recurse into subdirectories.
53 """
54 warnings.warn(
55 "importlib.resources.contents is deprecated. "
56 "Use files(anchor).iterdir() instead.",
57 DeprecationWarning,
58 stacklevel=1,
59 )
60 return (resource.name for resource in _get_resource(anchor, path_names).iterdir())
61
62
63def _get_encoding_arg(path_names, encoding):

Callers

nothing calls this directly

Calls 3

_get_resourceFunction · 0.85
warnMethod · 0.45
iterdirMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…