Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Check which attributes have been loaded without triggering imports #51

Copy link
Copy link
Open
@lagru

Description

@lagru
Issue body actions

Is there a mechanism to check which objects have been loaded and which ones are still in the "lazy" state? Looking through the code and inspecting the objects returned by lazy.attach_stub it didn't see an obvious way to do so.

Maybe this could be addressed by making attach not return simple functions but objects. E.g.

__getattr__, __dir__, _ = lazy.attach_stub(__name__, __file__)
__getattr__.loaded_names  # return names which were already loaded

I think this would be very helpful in debugging and testing that lazy loading actually works as intended.

I'd be happy to work on this if there is interest!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.