Skip to content

Commit 1be730e

Browse files
committed
Update document and add news entry
1 parent a9856b0 commit 1be730e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Doc/library/winreg.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,8 @@ will print ``Yes`` if the handle is currently valid (has not been closed or
772772
detached).
773773

774774
The object also support comparison semantics, so handle objects will compare
775-
true if they both reference the same underlying Windows handle value.
775+
true if they both reference the same underlying Windows handle value. Closed
776+
handle objects (those with a handle value of zero) always compare equal.
776777

777778
Handle objects can be converted to an integer (e.g., using the built-in
778779
:func:`int` function), in which case the underlying Windows handle value is
@@ -815,3 +816,6 @@ integer handle, and also disconnect the Windows handle from the handle object.
815816
will automatically close *key* when control leaves the :keyword:`with` block.
816817

817818

819+
.. versionchanged:: next
820+
Handle objects are now compared by their underlying Windows handle value
821+
instead of object identity.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Now :class:`winreg.PyHKEY` objects are compared by their underlying Windows
2+
registry handle value instead of their object identity.

0 commit comments

Comments
 (0)