Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

threading.RLock must not support*args, **kwargs arguments #102029

Closed
Assignees
sobolevn
Labels
3.13bugs and security fixesextension-modulesC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@sobolevn

Description

@sobolevn

Right now we have an interesting problem:_CRLock supports*args, **kwargs in__new__, while_PYRLock does not.

See:

  1. def__init__(self):
  2. rlock_new(PyTypeObject*type,PyObject*args,PyObject*kwds)
    (they are unused)

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:

  1. CPython's code never useRLock with arguments (and never say it has arguments)
  2. typeshed (a source of truth for all typecheckers and several IDEsnever had a single issue about missing*args, **kwargs in theirRLock's stub:https://github.com/python/typeshed/blob/0bb7d621d39d38bee7ce32e1ee920bd5bc4f9503/stdlib/threading.pyi#L113-L119
  3. We don't have any docs aboutRLock's signature

So, I think we can:

  1. Document thatRLock has() signature
  2. Remove*args, **kwargs from C impl
  3. 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 fixesextension-modulesC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp