Skip to content

Accept keyword arguments in SemLock constructors - #9188

Open
1ndahous3 wants to merge 1 commit into
RustPython:mainfrom
1ndahous3:semlock_keyword_args
Open

1ndahous3 wants to merge 1 commit 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-18T08:57:04.448353Z 88de3eb PR opened
ℹ️ 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 →

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.
  • Fix all pre-merge checks with AI
✨ 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 degrade performance by 13.54%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 61 untouched benchmarks
⏩ 4 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ rustpython[frozenset.py] 358.3 µs 414.4 µs -13.54%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing 1ndahous3:semlock_keyword_args (88de3eb) with main (9f6f771)

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. ↩

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.

1 participant