From 16d4c9efa4908daddeed802ecb0a2c1f4aa12f28 Mon Sep 17 00:00:00 2001 From: AN Long Date: Thu, 6 Nov 2025 00:24:46 +0900 Subject: [PATCH 1/3] Update winreg's docstring --- PC/winreg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PC/winreg.c b/PC/winreg.c index c7bc74728f1ff9..3552bdff0f6259 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -53,6 +53,7 @@ PyDoc_STRVAR(module_doc, "DeleteKey() - Deletes the specified key.\n" "DeleteKeyEx() - Deletes the specified key.\n" "DeleteValue() - Removes a named value from the specified registry key.\n" +"DeleteTree() - Deletes the specified key and all its subkeys and values recursively.\n" "EnumKey() - Enumerates subkeys of the specified open registry key.\n" "EnumValue() - Enumerates values of the specified open registry key.\n" "ExpandEnvironmentStrings() - Expand the env strings in a REG_EXPAND_SZ\n" @@ -107,7 +108,10 @@ PyDoc_STRVAR(PyHKEY_doc, "Operations:\n" "__bool__ - Handles with an open object return true, otherwise false.\n" "__int__ - Converting a handle to an integer returns the Win32 handle.\n" -"rich comparison - Handle objects are compared using the handle value."); +"__enter__ - Context manager entry, returns self.\n" +"__exit__ - Context manager exit, closes the handle.\n" +"__eq__ - Handle objects are equal if they represent the same Windows handle.\n" +"__ne__ - Handle objects are not equal if they represent different Windows handles."); From 3316b1df8bb10366518ee61dc86f545f7202236d Mon Sep 17 00:00:00 2001 From: AN Long Date: Thu, 6 Nov 2025 21:25:58 +0900 Subject: [PATCH 2/3] Update by review comments --- PC/winreg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PC/winreg.c b/PC/winreg.c index 3552bdff0f6259..070aceb1af85c3 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -108,10 +108,8 @@ PyDoc_STRVAR(PyHKEY_doc, "Operations:\n" "__bool__ - Handles with an open object return true, otherwise false.\n" "__int__ - Converting a handle to an integer returns the Win32 handle.\n" -"__enter__ - Context manager entry, returns self.\n" -"__exit__ - Context manager exit, closes the handle.\n" -"__eq__ - Handle objects are equal if they represent the same Windows handle.\n" -"__ne__ - Handle objects are not equal if they represent different Windows handles."); +"__enter__, __exit__ - Context manager support for 'with' statement, automatically closes handle.\n" +"__eq__, __ne__ - Equality comparison based on Windows handle value."); From 0f2ba12cd01972151d92c0d891edd77cb70be484 Mon Sep 17 00:00:00 2001 From: AN Long Date: Thu, 6 Nov 2025 21:33:56 +0900 Subject: [PATCH 3/3] Fix line length --- PC/winreg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PC/winreg.c b/PC/winreg.c index 070aceb1af85c3..66d64b899addcd 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -108,7 +108,8 @@ PyDoc_STRVAR(PyHKEY_doc, "Operations:\n" "__bool__ - Handles with an open object return true, otherwise false.\n" "__int__ - Converting a handle to an integer returns the Win32 handle.\n" -"__enter__, __exit__ - Context manager support for 'with' statement, automatically closes handle.\n" +"__enter__, __exit__ - Context manager support for 'with' statement,\n" +"automatically closes handle.\n" "__eq__, __ne__ - Equality comparison based on Windows handle value.");