@@ -155,8 +155,10 @@ UTF-8 encoded string. See :ref:`Configuration Options <pyinitconfig-opts>`.
155155 * Set *\* value *, and return ``0 `` on success.
156156 * Set an error in *config * and return ``-1 `` on error.
157157
158- *\* value * can be set to ``NULL `` if the option is an optional string and the
159- option is unset.
158+ *\* value * can be set to ``NULL `` if the option is unset or if the option is
159+ an optional string.
160+ Optional strings are documented with the type ``str | None `` in the
161+ :ref: `Configuration Options <pyinitconfig-opts >` table.
160162
161163 On success, the string must be released with ``free(value) `` if it's not
162164 ``NULL ``.
@@ -167,7 +169,7 @@ UTF-8 encoded string. See :ref:`Configuration Options <pyinitconfig-opts>`.
167169 Get a string list configuration option as an array of
168170 null-terminated UTF-8 encoded strings.
169171
170- * Set *\* length * and *\* value *, and return ``0 `` on success.
172+ * Set *\* length * and *\* items *, and return ``0 `` on success.
171173 * Set an error in *config * and return ``-1 `` on error.
172174
173175 On success, the string list must be released with
@@ -204,6 +206,9 @@ only implemented when ``Py_InitializeFromInitConfig()`` is called, not by the
204206 Set a string configuration option from a null-terminated UTF-8
205207 encoded string. The string is copied.
206208
209+ Options documented with the type ``str | None `` in the :ref: `Configuration
210+ Options <pyinitconfig-opts>` table can be set to ``NULL ``.
211+
207212 * Return ``0 `` on success.
208213 * Set an error in *config * and return ``-1 `` on error.
209214
@@ -275,15 +280,15 @@ Configuration Options
275280 - Public
276281 * - ``"base_exec_prefix" ``
277282 - :c:member: `base_exec_prefix <PyConfig.base_exec_prefix> `
278- - ``str ``
283+ - ``str | None ``
279284 - Public
280285 * - ``"base_executable" ``
281286 - :c:member: `base_executable <PyConfig.base_executable> `
282- - ``str ``
287+ - ``str | None ``
283288 - Public
284289 * - ``"base_prefix" ``
285290 - :c:member: `base_prefix <PyConfig.base_prefix> `
286- - ``str ``
291+ - ``str | None ``
287292 - Public
288293 * - ``"buffered_stdio" ``
289294 - :c:member: `buffered_stdio <PyConfig.buffered_stdio> `
@@ -331,15 +336,15 @@ Configuration Options
331336 - Read-only
332337 * - ``"dump_refs_file" ``
333338 - :c:member: `dump_refs_file <PyConfig.dump_refs_file> `
334- - ``str ``
339+ - ``str | None ``
335340 - Read-only
336341 * - ``"exec_prefix" ``
337342 - :c:member: `exec_prefix <PyConfig.exec_prefix> `
338- - ``str ``
343+ - ``str | None ``
339344 - Public
340345 * - ``"executable" ``
341346 - :c:member: `executable <PyConfig.executable> `
342- - ``str ``
347+ - ``str | None ``
343348 - Public
344349 * - ``"faulthandler" ``
345350 - :c:member: `faulthandler <PyConfig.faulthandler> `
@@ -359,7 +364,7 @@ Configuration Options
359364 - Read-only
360365 * - ``"home" ``
361366 - :c:member: `home <PyConfig.home> `
362- - ``str ``
367+ - ``str | None ``
363368 - Read-only
364369 * - ``"import_time" ``
365370 - :c:member: `import_time <PyConfig.import_time> `
@@ -385,6 +390,10 @@ Configuration Options
385390 - :c:member: `isolated <PyConfig.isolated> `
386391 - ``bool ``
387392 - Read-only
393+ * - ``"lazy_imports" ``
394+ - :c:member: `lazy_imports <PyConfig.lazy_imports> `
395+ - ``int ``
396+ - Public
388397 * - ``"legacy_windows_fs_encoding" ``
389398 - :c:member: `legacy_windows_fs_encoding <PyPreConfig.legacy_windows_fs_encoding> `
390399 - ``bool ``
@@ -431,35 +440,35 @@ Configuration Options
431440 - Public
432441 * - ``"prefix" ``
433442 - :c:member: `prefix <PyConfig.prefix> `
434- - ``str ``
443+ - ``str | None ``
435444 - Public
436445 * - ``"program_name" ``
437446 - :c:member: `program_name <PyConfig.program_name> `
438447 - ``str ``
439448 - Read-only
440449 * - ``"pycache_prefix" ``
441450 - :c:member: `pycache_prefix <PyConfig.pycache_prefix> `
442- - ``str ``
451+ - ``str | None ``
443452 - Public
444453 * - ``"quiet" ``
445454 - :c:member: `quiet <PyConfig.quiet> `
446455 - ``bool ``
447456 - Public
448457 * - ``"run_command" ``
449458 - :c:member: `run_command <PyConfig.run_command> `
450- - ``str ``
459+ - ``str | None ``
451460 - Read-only
452461 * - ``"run_filename" ``
453462 - :c:member: `run_filename <PyConfig.run_filename> `
454- - ``str ``
463+ - ``str | None ``
455464 - Read-only
456465 * - ``"run_module" ``
457466 - :c:member: `run_module <PyConfig.run_module> `
458- - ``str ``
467+ - ``str | None ``
459468 - Read-only
460469 * - ``"run_presite" ``
461470 - :c:member: `run_presite <PyConfig.run_presite> `
462- - ``str ``
471+ - ``str | None ``
463472 - Read-only
464473 * - ``"safe_path" ``
465474 - :c:member: `safe_path <PyConfig.safe_path> `
@@ -479,15 +488,15 @@ Configuration Options
479488 - Read-only
480489 * - ``"stdio_encoding" ``
481490 - :c:member: `stdio_encoding <PyConfig.stdio_encoding> `
482- - ``str ``
491+ - ``str | None ``
483492 - Read-only
484493 * - ``"stdio_errors" ``
485494 - :c:member: `stdio_errors <PyConfig.stdio_errors> `
486495 - ``str ``
487496 - Read-only
488497 * - ``"stdlib_dir" ``
489498 - :c:member: `stdlib_dir <PyConfig.stdlib_dir> `
490- - ``str ``
499+ - ``str | None ``
491500 - Public
492501 * - ``"tracemalloc" ``
493502 - :c:member: `tracemalloc <PyConfig.tracemalloc> `
@@ -542,6 +551,9 @@ Configuration Options
542551 - ``bool ``
543552 - Read-only
544553
554+ The type ``str | None `` means that the option is an optional string which can
555+ be set to ``NULL ``.
556+
545557Visibility:
546558
547559* Public: Can be retrieved by :c:func: `PyConfig_Get ` and set by
@@ -1591,6 +1603,21 @@ PyConfig
15911603 See also the :ref: `Isolated Configuration <init-isolated-conf >` and
15921604 :c:member: `PyPreConfig.isolated `.
15931605
1606+ .. c :member :: int lazy_imports
1607+
1608+ Control :ref: `lazy imports <lazy-imports >`.
1609+
1610+ A value of ``-1 `` keeps the default behaviour, where only imports marked
1611+ with the ``lazy `` keyword are lazy. A value of ``1 `` makes every import
1612+ lazy. ``0 `` is rejected.
1613+
1614+ Configured by the :option: `-X lazy_imports <-X> ` command line option or
1615+ the :envvar: `PYTHON_LAZY_IMPORTS ` environment variable.
1616+
1617+ Default: ``-1 ``.
1618+
1619+ .. versionadded :: 3.15
1620+
15941621 .. c :member :: int legacy_windows_stdio
15951622
15961623 If non-zero, use :class: `io.FileIO ` instead of
@@ -1948,7 +1975,7 @@ PyConfig
19481975 If equals to zero, ignore the :ref:`environment variables
19491976 <using-on-envvars>`.
19501977
1951- Set to ``0`` by the :option:`-E` environment variable .
1978+ Set to ``0`` by the :option:`-E` command-line option .
19521979
19531980 Default: ``1`` in Python config and ``0`` in isolated config.
19541981
0 commit comments