Make set_max_threads() discard its argument - #400
Merged
Merged
Conversation
The binding warned that user_threads was ignored but still forwarded it to SetMaxThreads(), coupling the binding to legacy behavior. Discard the parameter and always call SetMaxThreads(0). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Resolve the documented negative-value behavior and add focused regression coverage.
Review effort: Lite
Findings: None
What changed in this PR
Updates the deprecated Python set_max_threads() wrapper to ignore its argument and call SetMaxThreads(0).
Changes:
- Discards
user_threads. - Preserves the deprecation warning.
| File | Summary |
|---|---|
python/src/bindings.cpp |
Updates deprecated thread initialization behavior; documentation consistency and regression coverage remain unresolved. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot flagged that the docs promised ValueError for negative user_threads, but the binding has never validated the sign — it is always ignored, including negative values. Correct the docs to match actual behavior and add regression tests locking in that a negative value is accepted, not rejected. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
set_max_threads()warned thatuser_threadswas ignored but still forwarded it toSetMaxThreads(), coupling the binding to legacy C-API behavior and contradicting its own docstring/deprecation warning.SetMaxThreads(0), matching the documented "ignored" behavior.Test plan
set_max_threads(n)still emits theDeprecationWarningfor anyn.🤖 Generated with Claude Code
Closes #337