Skip to content

Commit 7b72d16

Browse files
authored
PEP 810: Add clarification on the warnings for global mode (#4667)
1 parent 419d37b commit 7b72d16

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

peps/pep-0810.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,12 @@ After several calls, ``LOAD_GLOBAL`` specializes to ``LOAD_GLOBAL_MODULE``:
591591
Lazy imports filter
592592
-------------------
593593

594-
*Note: This is an advanced feature. Library developers should NOT call these
595-
functions. These are intended for specialized/advanced users who need
596-
fine-grained control over lazy import behavior when using the global flags.*
594+
*Note: This is an advanced feature. These are intended for specialized/advanced
595+
users who need fine-grained control over lazy import behavior when using the
596+
global flags. Library developers are discouraged from using these functions as
597+
they can affect the runtime execution of applications (similar to
598+
``sys.setrecursionlimit()``, ``sys.setswitchinterval()``, or
599+
``gc.set_threshold()``).*
597600

598601
This PEP adds the following new functions to the ``sys`` module to manage the
599602
lazy imports filter:
@@ -672,9 +675,12 @@ Example:
672675
Global lazy imports control
673676
----------------------------
674677

675-
*Note: This is an advanced feature. Library developers should NOT use the global
676-
activation mechanism. This is intended for application developers and framework
677-
authors who need to control lazy imports across their entire application.*
678+
*Note: This is an advanced feature. This is intended for application developers
679+
and framework authors who need to control lazy imports across their entire
680+
application. Library developers are discouraged from using the global activation
681+
mechanism as it can affect the runtime execution of applications (similar to
682+
``sys.setrecursionlimit()``, ``sys.setswitchinterval()``, or
683+
``gc.set_threshold()``).*
678684

679685
The global lazy imports flag can be controlled through:
680686

0 commit comments

Comments
 (0)