Skip to content

importlib.resources.abc.ResourceReader docs/implementation discrepancies #143513

@moreati

Description

@moreati

Documentation

Docs for importlib.resources.abc.ResourceReader and the implementation differ in a few details. So far I've noticed

  • Parameter name of is_resource() differs
    Docs: is_resource(name).
    Code: is_resource(... path ...)Implementation calls the parameter path
  • Behaviour of contents() differs
    Docs: "The abstract method returns an iterable of no items."
    Code: raise FileNotFoundError

If fixes are desired then I'm happy to take it on, and coordinate fixes with e.g. https://github.com/python/importlib_resources, https://github.com/python/typeshed

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions