Skip to content

Commit f7d9848

Browse files
committed
fixup! fixup! PEP 810: Updates based on feedback
1 parent 968099d commit f7d9848

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

peps/pep-0810.rst

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,10 @@ Reification
366366

367367
When a lazy object is first used, it needs to be reified. This means resolving
368368
the import at that point in the program and replacing the lazy object with the
369-
concrete one. Lazy modules are imported using the import system at the time of
370-
reification. The value of ``__import__`` and all import system state (e.g.,
371-
``sys.path``, ``sys.meta_path``, ``sys.path_hooks``) are resolved at
372-
reification time, not when the lazy import statement is executed.
369+
concrete one. Reification imports the module in the same way as it would have
370+
been if it had been imported eagerly, barring intervening changes to the
371+
import system (e.g. to ``sys.path``, ``sys.meta_path``, ``sys.path_hooks`` or
372+
``__import__``).
373373

374374
Reification still calls ``__import__`` to resolve the import. When the module
375375
is first reified, it's removed from ``sys.lazy_modules`` (even if there are
@@ -1439,11 +1439,6 @@ any eager import.
14391439
14401440
print('json' in sys.modules) # True
14411441
1442-
Note that the import system state (including ``sys.path`` and ``__import__``)
1443-
is evaluated at reification time, not when the lazy import statement executes.
1444-
This means that modifications to the import system between the lazy import
1445-
statement and first use will affect how the module is resolved.
1446-
14471442
Does ``lazy from __future__ import feature`` work?
14481443
--------------------------------------------------
14491444

0 commit comments

Comments
 (0)