Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ name:
lazy import json
lazy from pathlib import Path

print("Starting up...") # json and pathlib not loaded yet
print("Starting up...") # json and pathlib are not fully imported yet

data = json.loads('{"key": "value"}') # json loads here
p = Path(".") # pathlib loads here
data = json.loads('{"key": "value"}') # json gets fully imported here
p = Path(".") # pathlib gets fully imported here

This mechanism is particularly useful for applications that import many
modules at the top level but may only use a subset of them in any given run.
Expand Down
Loading