Skip to content

Make set_max_threads() discard its argument - #400

Merged
zzcgumn merged 2 commits into
developfrom
fix/set_max_threads_documentation
Sep 23, 2026
Merged

zzcgumn merged 2 commits into
developfrom
fix/set_max_threads_documentation

Conversation

@zzcgumn

@zzcgumn zzcgumn commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • set_max_threads() warned that user_threads was ignored but still forwarded it to SetMaxThreads(), coupling the binding to legacy C-API behavior and contradicting its own docstring/deprecation warning.
  • Discard the parameter and always call SetMaxThreads(0), matching the documented "ignored" behavior.
  • Addresses Make set_max_threads() behavior consistent with its documentation #337.

Test plan

  • Build the Python bindings and confirm set_max_threads(n) still emits the DeprecationWarning for any n.
  • Confirm existing Python test suite passes.

🤖 Generated with Claude Code

Closes #337

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@tameware tameware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation, tests, and documentation consistently reflect the intended behavior.

Review effort: Lite
Findings: None

@zzcgumn zzcgumn added the Clean Copilot review Copilot reviewed and had neither new comments nor new suppressed comments. label Sep 23, 2026
@zzcgumn
zzcgumn merged commit 2e543ef into develop Sep 23, 2026
14 of 15 checks passed
@zzcgumn
zzcgumn deleted the fix/set_max_threads_documentation branch September 23, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Clean Copilot review Copilot reviewed and had neither new comments nor new suppressed comments.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make set_max_threads() behavior consistent with its documentation

3 participants