Skip to content

Commit 20942f3

Browse files
committed
Update by review comments
1 parent 2f0d394 commit 20942f3

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

Doc/library/winreg.rst

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -692,78 +692,82 @@ For more information, see `Registry Value Types
692692
.. data:: REG_BINARY
693693

694694
Binary data in any form.
695-
You should pass a :term:`bytes-like object` or :const:`None` in Python for this type.
695+
*value* must be a :term:`bytes-like object` in Python for this type.
696696

697697
.. data:: REG_DWORD
698698

699699
32-bit number.
700-
You should pass an :class:`int` or :const:`None` in Python for this type.
700+
*value* must be an :class:`int` in Python for this type.
701701

702702
.. data:: REG_DWORD_LITTLE_ENDIAN
703703

704704
A 32-bit number in little-endian format. Equivalent to :const:`REG_DWORD`.
705-
You should pass an :class:`int` or :const:`None` in Python for this type.
705+
*value* must be an :class:`int` in Python for this type.
706706

707707
.. data:: REG_DWORD_BIG_ENDIAN
708708

709709
A 32-bit number in big-endian format.
710-
You should pass an :class:`int` or :const:`None` in Python for this type.
710+
*value* must be an :class:`int` in Python for this type.
711711

712712
.. data:: REG_EXPAND_SZ
713713

714714
Null-terminated string containing references to environment
715715
variables (``%PATH%``).
716-
You should pass a :class:`str` or :const:`None` in Python for this type.
716+
*value* must be a :class:`str` in Python for this type.
717717

718718
.. data:: REG_LINK
719719

720720
A Unicode symbolic link.
721-
You should pass a :term:`bytes-like object` or :const:`None` in Python for this type.
721+
*value* must be a :term:`bytes-like object` in Python for this type.
722722

723723
.. data:: REG_MULTI_SZ
724724

725725
A sequence of null-terminated strings, terminated by two null characters.
726726
(Python handles this termination automatically.)
727-
You should pass a :class:`list` of :class:`str` or :const:`None` in Python for this type.
727+
*value* must be a :class:`list` of :class:`str` in Python for this type.
728728

729729
.. data:: REG_NONE
730730

731731
No defined value type.
732-
You should pass a :term:`bytes-like object` or :const:`None` in Python for this type.
732+
*value* must be a :term:`bytes-like object` in Python for this type.
733733

734734
.. data:: REG_QWORD
735735

736736
A 64-bit number.
737-
You should pass an :class:`int` or :const:`None` in Python for this type.
737+
*value* must be an :class:`int` in Python for this type.
738738

739739
.. versionadded:: 3.6
740740

741741
.. data:: REG_QWORD_LITTLE_ENDIAN
742742

743743
A 64-bit number in little-endian format. Equivalent to :const:`REG_QWORD`.
744-
You should pass an :class:`int` or :const:`None` in Python for this type.
744+
*value* must be an :class:`int` in Python for this type.
745745

746746
.. versionadded:: 3.6
747747

748748
.. data:: REG_RESOURCE_LIST
749749

750750
A device-driver resource list.
751-
You should pass a :term:`bytes-like object` or :const:`None` in Python for this type.
751+
*value* must be a :term:`bytes-like object` in Python for this type.
752752

753753
.. data:: REG_FULL_RESOURCE_DESCRIPTOR
754754

755755
A hardware setting.
756-
You should pass a :term:`bytes-like object` or :const:`None` in Python for this type.
756+
*value* must be a :term:`bytes-like object` in Python for this type.
757757

758758
.. data:: REG_RESOURCE_REQUIREMENTS_LIST
759759

760760
A hardware resource list.
761-
You should pass a :term:`bytes-like object` or :const:`None` in Python for this type.
761+
*value* must be a :term:`bytes-like object` in Python for this type.
762762

763763
.. data:: REG_SZ
764764

765765
A null-terminated string.
766-
You should pass a :class:`str` or :const:`None` in Python for this type.
766+
*value* must be a :class:`str` in Python for this type.
767+
768+
Note that :const:`None` is also accepted for these types. when :const:`None`
769+
is passed, it is converted to the corresponding zero or empty value for the type
770+
(0 for integers, empty string for strings, empty list for multi-strings, etc.).
767771

768772

769773
.. _handle-object:

0 commit comments

Comments
 (0)