Skip to content

Commit c467bff

Browse files
committed
Add note on set_lazy_imports
1 parent f599f61 commit c467bff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

peps/pep-0810.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,11 @@ lazy* import is ever imported lazily, the import filter is never called, and
659659
the behavior is equivalent to a regular ``import`` statement: the import is
660660
*eager* (as if the lazy keyword was not used).
661661

662+
Python code can run the :func:`!sys.set_lazy_imports` function to override
663+
the state of the global lazy imports flag inherited from the environment or CLI.
664+
This is especially useful if an application needs to ensure that all imports
665+
are evaluated eagerly, via ``sys.set_lazy_imports('disabled')``.
666+
662667

663668
Backwards Compatibility
664669
=======================

0 commit comments

Comments
 (0)