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
Is your feature request related to a problem? A clear and concise description of what the problem is: "I'm always frustrated when ..."
Inspired by @deepyaman#2673, https://peps.python.org/pep-0562/ shows some new way of doing lazy imports. It may change the discussion in #712.
# lib/__init__.pyimportimportlib__all__= ['submod', ...]
def__getattr__(name):
ifnamein__all__:
returnimportlib.import_module("."+name, __name__)
raiseAttributeError(f"module {__name__!r} has no attribute {name!r}")
# lib/submod.pyprint("Submodule loaded")
classHeavyClass:
...
# main.pyimportliblib.submod.HeavyClass# prints "Submodule loaded"
Context
Why is this change important to you? How would you use it? How can it benefit other users?
Possible Implementation
(Optional) Suggest an idea for implementing the addition or change.
Possible Alternatives
(Optional) Describe any alternative solutions or features you've considered.
The text was updated successfully, but these errors were encountered:
Description
Is your feature request related to a problem? A clear and concise description of what the problem is: "I'm always frustrated when ..."
Inspired by @deepyaman #2673, https://peps.python.org/pep-0562/ shows some new way of doing lazy imports. It may change the discussion in #712.
Context
Why is this change important to you? How would you use it? How can it benefit other users?
Possible Implementation
(Optional) Suggest an idea for implementing the addition or change.
Possible Alternatives
(Optional) Describe any alternative solutions or features you've considered.
The text was updated successfully, but these errors were encountered: