Bug report
Bug description:
There is the document for winreg.HKEYType:
|
The object also support comparison semantics, so handle objects will compare |
|
true if they both reference the same underlying Windows handle value. |
But the winreg.HKEYType don't have a custom compare implementation, so it will be compared by id.
And there is a compare function in the codebase, which actually is a dead code, and still compared by id:
|
static int |
|
PyHKEY_compareFunc(PyObject *ob1, PyObject *ob2) |
|
{ |
|
PyHKEYObject *pyhkey1 = (PyHKEYObject *)ob1; |
|
PyHKEYObject *pyhkey2 = (PyHKEYObject *)ob2; |
|
return pyhkey1 == pyhkey2 ? 0 : |
|
(pyhkey1 < pyhkey2 ? -1 : 1); |
|
} |
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows
Linked PRs
Bug report
Bug description:
There is the document for
winreg.HKEYType:cpython/Doc/library/winreg.rst
Lines 774 to 775 in 81cec22
But the
winreg.HKEYTypedon't have a custom compare implementation, so it will be compared by id.And there is a compare function in the codebase, which actually is a dead code, and still compared by id:
cpython/PC/winreg.c
Lines 184 to 191 in 81cec22
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows
Linked PRs