File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -247,8 +247,25 @@ Initialization Callback
247247 Python interpreter is initialized, before the first import. For example, it
248248 can be used to add a meta path importer into :data: `sys.meta_path `.
249249
250- Python is not fully initialized yet when the callback is called. For
251- example, :data: `sys.stdout ` may not exist yet.
250+ When the callback is called, Python is only partially initialized. What's
251+ available at this point:
252+
253+ * Builtin types;
254+ * Builtin exceptions;
255+ * Builtin and frozen modules (can be imported);
256+ * The :mod: `sys ` module is only partially initialized
257+ (ex: :data: `sys.path ` and :data: `sys.stdout ` don't exist yet).
258+
259+ After the callback, the Python initialization is completed:
260+
261+ * Install and configure :mod:`importlib`;
262+ * Apply the :ref: `Path Configuration <init-path-config >`;
263+ * Install signal handlers;
264+ * Finish :mod: `sys ` module initialization (ex: create :data: `sys.stdout `
265+ and :data: `sys.path `);
266+ * Enable optional features like :mod: `faulthandler ` and :mod: `tracemalloc `;
267+ * Import the :mod: `site ` module;
268+ * etc.
252269
253270 A single callback can be registered. If this function is called more than
254271 once, the previous callback is overridden.
You can’t perform that action at this time.
0 commit comments