Skip to content

Reloading a lazy module that has not yet been materailized should be no-op #139686

@QEDady

Description

@QEDady

Bug report

Bug description:

Reloading a not-yet materialized lazy module is not supported well. It makes sense for the reloading in this case to be no-op since when the actual loading happens e.g. by accessing an attribute, the new code will be loaded anyway. Currently, the reload tries to reload the module while its loaded is lazy in the first place.

CPython versions tested on:

3.13, 3.12, 3.14, CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-importlibtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions