You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the importlib.resources.abc.ResourceReader.is_resource case, judging by this change in the typeshed, the parameter used to be name until 3.10 but the documentation must have not been updated accordingly (I didn't confirm with our log though :-)).
It may be desired to pass this parameter by keyword, so the name matters in terms of our API contract.
Therefore I'd say yes, fixing this in the docs is desired definitely!
However, in the contents() case: @jaraco, should we change the last sentence from the documentation or should the behavior be updated to reflect the documentation?
contents() timeline (near identical to is_resource() timeline above)
4ac5150 (Py 3.7) adds importlib.abc.ResourceReader, with contents() returning an empty interator
6714825 (Py 3.10) resources in namespaces support, change to raise FileNotFoundError
e712a5b (Py 3.11) moves to importlib.resources.abc.ResourceReader
importlib_resources.abc.ResourceReader.contents() has consistently raised FileNotFoundError since it was added in python/importlib_resources@e82b567. Typeshed doesn't care, exceptions aren't part of a type signature.
Activity
johnslavik commentedon Jan 7, 2026
Thank you!
In the
importlib.resources.abc.ResourceReader.is_resourcecase, judging by this change in the typeshed, the parameter used to benameuntil 3.10 but the documentation must have not been updated accordingly (I didn't confirm with our log though :-)).It may be desired to pass this parameter by keyword, so the name matters in terms of our API contract.
Therefore I'd say yes, fixing this in the docs is desired definitely!
However, in the
contents()case: @jaraco, should we change the last sentence from the documentation or should the behavior be updated to reflect the documentation?johnslavik commentedon Jan 7, 2026
I don't think we'll change
contents()anyway so I'd say go for the two fixes :-)moreati commentedon Jan 7, 2026
Timeline for my reference
importlib.abc.ResourceReader, withis_resource(name)is_resource(path)importlib.resources.abc.ResourceReaderimportlib_resources.abc.ResourceReaderhas consistently usedis_resource(path)since that method was added in python/importlib_resources@e82b567pythongh-143513: Clarify changed argument name of ResourceReader.is_r…
gh-143513: Clarify changed argument name of `ResourceReader.is_resour…
pythongh-143513: Clarify changed argument name of `ResourceReader.is_…
pythongh-143513: Clarify changed argument name of `ResourceReader.is_…
[3.14] gh-143513: Clarify changed argument name of `ResourceReader.is…
[3.13] gh-143513: Clarify changed argument name of `ResourceReader.is…
moreati commentedon Jan 8, 2026
contents()timeline (near identical tois_resource()timeline above)importlib.abc.ResourceReader, withcontents()returning an empty interatorraise FileNotFoundErrorimportlib.resources.abc.ResourceReaderimportlib_resources.abc.ResourceReader.contents()has consistently raisedFileNotFoundErrorsince it was added in python/importlib_resources@e82b567. Typeshed doesn't care, exceptions aren't part of a type signature.moreati commentedon Jan 8, 2026
ResourceReaderand others were removed fromimportlib.abcin Python 3.14 but docs still mention themCode: 0751511#diff-f3e6ca7132200b34d6d4bdd7799b8b8270a33bd59945e034b50427893a2a9ca3
Docs:
cpython/Doc/library/importlib.rst
Line 605 in cea2d24
pythonGH-143513 Clarify historic behaviour of importlib ResourceReader
pythonGH-143513: Remove importlib.abc documentation for removed ABCs
pythonGH-143513: Remove importlib.abc documentation for removed ABCs
pythongh-143513: Clarify changed argument name of `ResourceReader.is_…
gh-143513: Remove importlib.abc documentation for removed ABCs (#143605)
pythongh-143513: Remove importlib.abc documentation for removed ABCs (p…
[3.14] gh-143513: Remove importlib.abc documentation for removed ABCs (…
pythonGH-143513 Clarify historic behaviour of importlib ResourceReader
pythongh-143513: Clarify changed argument name of `ResourceReader.is_…
pythongh-143513: Remove importlib.abc documentation for removed ABCs (p…
pythonGH-143513 Clarify historic behaviour of importlib ResourceReader
pythonGH-143513 Clarify historic behaviour of importlib ResourceReader