Skip to content

Lazy-load function patches #298

Open
@pschanely

Description

@pschanely

Importing CrossHair transitively imports a ~majority of the standard library, because we register patches for it all. It would be better to register patches only for the currently loaded modules and load other patches just-in-time via some sort of import hook.

This also will fix a failure mode where re-importing a module will break the existing patches. (see heapqlib_test.test_heapify for an example)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions