-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Closed
Labels
3.13bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirstdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Right now we have an interesting problem: _CRLock
supports *args, **kwargs
in __new__
, while _PYRLock
does not.
See:
Line 133 in 128379b
def __init__(self): cpython/Modules/_threadmodule.c
Line 506 in 128379b
rlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
I am leaving aside the problem that _PYRLock
is not ever used (unless imported directly) for now.
Right now our docs does not say what the signature should be.
Some facts:
- CPython's code never use
RLock
with arguments (and never say it has arguments) - typeshed (a source of truth for all typecheckers and several IDEs never had a single issue about missing
*args, **kwargs
in theirRLock
's stub: https://github.com/python/typeshed/blob/0bb7d621d39d38bee7ce32e1ee920bd5bc4f9503/stdlib/threading.pyi#L113-L119 - We don't have any docs about
RLock
's signature
So, I think we can:
- Document that
RLock
has()
signature - Remove
*args, **kwargs
from C impl - Document this in "What's new"
Does it sound like a plan? If yes, I would like to do the honours :)
Linked PRs
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirstdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error