Skip to content

Commit 2101488

Browse files
committed
Mention NULL in SetStr() documentation
1 parent 3893f25 commit 2101488

1 file changed

Lines changed: 20 additions & 15 deletions

File tree

‎Doc/c-api/init_config.rst‎

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ only implemented when ``Py_InitializeFromInitConfig()`` is called, not by the
204204
Set a string configuration option from a null-terminated UTF-8
205205
encoded string. The string is copied.
206206
207+
Options documented with the type ``str | None`` in the :ref:`Configuration
208+
Options <pyinitconfig-opts>` table can be set to ``NULL``.
209+
207210
* Return ``0`` on success.
208211
* Set an error in *config* and return ``-1`` on error.
209212
@@ -275,15 +278,15 @@ Configuration Options
275278
- Public
276279
* - ``"base_exec_prefix"``
277280
- :c:member:`base_exec_prefix <PyConfig.base_exec_prefix>`
278-
- ``str``
281+
- ``str | None``
279282
- Public
280283
* - ``"base_executable"``
281284
- :c:member:`base_executable <PyConfig.base_executable>`
282-
- ``str``
285+
- ``str | None``
283286
- Public
284287
* - ``"base_prefix"``
285288
- :c:member:`base_prefix <PyConfig.base_prefix>`
286-
- ``str``
289+
- ``str | None``
287290
- Public
288291
* - ``"buffered_stdio"``
289292
- :c:member:`buffered_stdio <PyConfig.buffered_stdio>`
@@ -331,15 +334,15 @@ Configuration Options
331334
- Read-only
332335
* - ``"dump_refs_file"``
333336
- :c:member:`dump_refs_file <PyConfig.dump_refs_file>`
334-
- ``str``
337+
- ``str | None``
335338
- Read-only
336339
* - ``"exec_prefix"``
337340
- :c:member:`exec_prefix <PyConfig.exec_prefix>`
338-
- ``str``
341+
- ``str | None``
339342
- Public
340343
* - ``"executable"``
341344
- :c:member:`executable <PyConfig.executable>`
342-
- ``str``
345+
- ``str | None``
343346
- Public
344347
* - ``"faulthandler"``
345348
- :c:member:`faulthandler <PyConfig.faulthandler>`
@@ -359,7 +362,7 @@ Configuration Options
359362
- Read-only
360363
* - ``"home"``
361364
- :c:member:`home <PyConfig.home>`
362-
- ``str``
365+
- ``str | None``
363366
- Read-only
364367
* - ``"import_time"``
365368
- :c:member:`import_time <PyConfig.import_time>`
@@ -431,35 +434,35 @@ Configuration Options
431434
- Public
432435
* - ``"prefix"``
433436
- :c:member:`prefix <PyConfig.prefix>`
434-
- ``str``
437+
- ``str | None``
435438
- Public
436439
* - ``"program_name"``
437440
- :c:member:`program_name <PyConfig.program_name>`
438441
- ``str``
439442
- Read-only
440443
* - ``"pycache_prefix"``
441444
- :c:member:`pycache_prefix <PyConfig.pycache_prefix>`
442-
- ``str``
445+
- ``str | None``
443446
- Public
444447
* - ``"quiet"``
445448
- :c:member:`quiet <PyConfig.quiet>`
446449
- ``bool``
447450
- Public
448451
* - ``"run_command"``
449452
- :c:member:`run_command <PyConfig.run_command>`
450-
- ``str``
453+
- ``str | None``
451454
- Read-only
452455
* - ``"run_filename"``
453456
- :c:member:`run_filename <PyConfig.run_filename>`
454-
- ``str``
457+
- ``str | None``
455458
- Read-only
456459
* - ``"run_module"``
457460
- :c:member:`run_module <PyConfig.run_module>`
458-
- ``str``
461+
- ``str | None``
459462
- Read-only
460463
* - ``"run_presite"``
461464
- :c:member:`run_presite <PyConfig.run_presite>`
462-
- ``str``
465+
- ``str | None``
463466
- Read-only
464467
* - ``"safe_path"``
465468
- :c:member:`safe_path <PyConfig.safe_path>`
@@ -479,15 +482,15 @@ Configuration Options
479482
- Read-only
480483
* - ``"stdio_encoding"``
481484
- :c:member:`stdio_encoding <PyConfig.stdio_encoding>`
482-
- ``str``
485+
- ``str | None``
483486
- Read-only
484487
* - ``"stdio_errors"``
485488
- :c:member:`stdio_errors <PyConfig.stdio_errors>`
486489
- ``str``
487490
- Read-only
488491
* - ``"stdlib_dir"``
489492
- :c:member:`stdlib_dir <PyConfig.stdlib_dir>`
490-
- ``str``
493+
- ``str | None``
491494
- Public
492495
* - ``"tracemalloc"``
493496
- :c:member:`tracemalloc <PyConfig.tracemalloc>`
@@ -542,6 +545,8 @@ Configuration Options
542545
- ``bool``
543546
- Read-only
544547
548+
The type ``str | None`` means that a string can be ``NULL``.
549+
545550
Visibility:
546551
547552
* Public: Can be retrieved by :c:func:`PyConfig_Get` and set by

0 commit comments

Comments
 (0)