Keep pythonnet overloads hint in NoMethodMatchPythonExceptionInterpreter message#9594
Merged
jhonabreul merged 1 commit intoJul 7, 2026
Conversation
…ter message
The interpreter replaced the original pythonnet binding-failure message
with a friendly one built from the parsed method name, discarding the
candidate-signatures hint pythonnet 2.0.57+ appends ("The expected
signature is:" / "The following overloads are available:" followed by
the signatures). That hint is what lets users see which parameter
didn't match, so extract it from the original message and append it to
the interpreted one.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Martin-Molinero
approved these changes
Jul 7, 2026
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.
Description
Since pythonnet 2.0.57, the "No method matches given arguments" TypeError message includes the candidate signatures so the caller can see what the method expects:
NoMethodMatchPythonExceptionInterpreterreplaced the original message with a friendly one built from the parsed method name, discarding that hint. The hint section ("The expected signature is:" / "The following overloads are available:" plus the signatures) is now extracted from the original message and appended to the interpreted one:Related Issue
N/A — follow-up to #9573; the hint was reported missing from interpreted messages of Python algorithms failing overload resolution (e.g.
self.limit_order(symbol, contracts, entry, "tag"), where the hint reveals the tag must be passed as a keyword since theasynchronousparameter was introduced).Motivation and Context
The signatures hint is the part of the message that tells users which parameter didn't match and how to fix the call; dropping it left only the method name.
Requires Documentation Change
No.
How Has This Been Tested?
Added two tests to
NoMethodMatchPythonExceptionInterpreterTests, one per hint wording:VerifyMessageKeepsTheOverloadsHint—set_cash('SPY')(multiple candidates, "The following overloads are available:").VerifyMessageKeepsTheExpectedSignatureHint—rsi(symbol, 15, Resolution.DAILY)(candidates collapse to a single signature, "The expected signature is:").Both fail before the fix and pass after. Full
NoMethodMatchPythonExceptionInterpreterTestsfixture passes (15/15) and the wholeTests.Common.Exceptionssuite passes (103/103).Types of changes
Checklist:
🤖 Generated with Claude Code