Skip to content

Accept keyword arguments in SemLock constructors - #9188

Merged
youknowone merged 2 commits into
RustPython:mainfrom
1ndahous3:semlock_keyword_args
Oct 18, 2026
Merged

youknowone merged 2 commits into
RustPython:mainfrom
1ndahous3:semlock_keyword_args

Conversation

@1ndahous3

@1ndahous3 1ndahous3 commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Found while importing Joblib 1.6.0, which passes name and unlink by keyword when checking semaphore support.

Summary

Allow all five SemLock constructor arguments by position or keyword on Windows and Unix, matching CPython.

AI assistance

Written with Codex (GPT-6), reviewed by a human before submission.

Summary by CodeRabbit

  • Bug Fixes
    • Semaphore construction now accepts kind, value, maxvalue, name, and unlink as either positional or keyword arguments on Windows and Unix. Existing argument names and types are unchanged.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T11:37:19.255612Z e542b79 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: RustPython/RustPython/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8450702d-d4b9-46e0-9451-a62028a670d6
📥 Commits

Reviewing files that changed from the base of the PR and between 88de3eb and e542b79.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: RustPython/RustPython/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3be5e73b-19b0-4672-8b11-5616fba730f2
📥 Commits

Reviewing files that changed from the base of the PR and between 9f6f771 and 88de3eb.

📒 Files selected for processing: 2
  • crates/stdlib/src/multiprocessing.rs
  • extra_tests/snippets/stdlib_multiprocessing_condition.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

📝 Walkthrough

SemLock constructor arguments now accept keyword parsing on Windows and Unix. The multiprocessing snippet tests positional and keyword construction, along with acquire and release behavior.

Changes: SemLock constructor arguments

Layer / File(s) Summary
Constructor argument parsing and tests
crates/stdlib/src/multiprocessing.rs, extra_tests/snippets/stdlib_multiprocessing_condition.py
Both platform-specific argument definitions accept keyword arguments. The snippet checks positional and keyword construction, successful acquisition, rejection of a second nonblocking acquisition, and release.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: youknowone

Merge Risk: ⚪ Minimal · up to 88de3

SemLock constructors now accept keyword arguments, matching CPython and fixing the Joblib import case. No merge-blocking risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: enabling keyword arguments in SemLock constructors on Windows and Unix.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codspeed

codspeed Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing 1ndahous3:semlock_keyword_args (e542b79) with main (3f55cf4)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Assisted-by: Codex:GPT-6
@youknowone
youknowone merged commit 7750dbc into RustPython:main Oct 18, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants