From 17f7c62641368abb0a08330ce873ed489516afae Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Wed, 22 Oct 2025 14:03:04 +0100 Subject: [PATCH] PEP 810: Add clarification on the warnings for global mode --- peps/pep-0810.rst | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/peps/pep-0810.rst b/peps/pep-0810.rst index ed52fac249f..418bd692570 100644 --- a/peps/pep-0810.rst +++ b/peps/pep-0810.rst @@ -591,9 +591,12 @@ After several calls, ``LOAD_GLOBAL`` specializes to ``LOAD_GLOBAL_MODULE``: Lazy imports filter ------------------- -*Note: This is an advanced feature. Library developers should NOT call these -functions. These are intended for specialized/advanced users who need -fine-grained control over lazy import behavior when using the global flags.* +*Note: This is an advanced feature. These are intended for specialized/advanced +users who need fine-grained control over lazy import behavior when using the +global flags. Library developers are discouraged from using these functions as +they can affect the runtime execution of applications (similar to +``sys.setrecursionlimit()``, ``sys.setswitchinterval()``, or +``gc.set_threshold()``).* This PEP adds the following new functions to the ``sys`` module to manage the lazy imports filter: @@ -672,9 +675,12 @@ Example: Global lazy imports control ---------------------------- -*Note: This is an advanced feature. Library developers should NOT use the global -activation mechanism. This is intended for application developers and framework -authors who need to control lazy imports across their entire application.* +*Note: This is an advanced feature. This is intended for application developers +and framework authors who need to control lazy imports across their entire +application. Library developers are discouraged from using the global activation +mechanism as it can affect the runtime execution of applications (similar to +``sys.setrecursionlimit()``, ``sys.setswitchinterval()``, or +``gc.set_threshold()``).* The global lazy imports flag can be controlled through: