Incomplete diagnostic message
Again, misleading or ambiguous diagnostic messages are a bug in a type checker: what is the value of a diagnostic message that has less information than an Exception thrown by the interpreter?
from cytoolz.itertoolz import concat as concatenate
from itertools import repeat
aa = concatenate((0,), repeat(tuple([-magnitudeOfAddends])))
[{
"resource": "/c:/apps/mapFolding/mapFolding/_e/analysisPython/theExcluderBeast.py",
"owner": "Pylance",
"code": {
"value": "reportCallIssue",
"target": {
"$mid": 1,
"path": "/microsoft/pylance-release/blob/main/docs/diagnostics/reportCallIssue.md",
"scheme": "https",
"authority": "github.com"
}
},
"severity": 8,
"message": "Expected 1 positional argument",
"source": "Pylance",
"startLineNumber": 344,
"startColumn": 25,
"endLineNumber": 344,
"endColumn": 61,
"origin": "extHost1"
}]
As often happens, due to the 1) ambiguous and 2) misleading diagnostic message, I spent far too long deconstructing this statement trying to find the problem. Simply using SVO would fix this problem and many other writing problems in the diagnostic messages.
It is hubris to think that because y'all know how to write code, you know how to write.
Hi @hunterhogan, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
Similar Issues (FYI only, not solutions)
The following issues may or may not be related to your report. They are provided for reference only, as they may describe similar symptoms, affect the same feature, or address related concerns, but may not be the same issue.
- SVO – proposal to reformat Pyright’s diagnostic messages into a clear subject-verb-object structure to reduce ambiguity. https://github.com/microsoft/pyright/issues/10454
The team will respond to your issue shortly. Please note this is a trial feature and may not be fully accurate. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or was incorrect, please give it a 👎. Your feedback helps us improve!
Thanks for the issue. Do you have a suggestion for what you want the message to be? Expected 1 positional argument seems pretty unambiguous to me.
What did the runtime show? I can't determine that without having the imported packages available.
Do you have a suggestion for what you want the message to be? ``
SVO, Subject Verb Object, because as you know, English does not encode the subject by reflecting the verb--unlike nearly every other European language. "Expected 1 positional argument" has an unambiguous verb and object, but who or what subject expected the argument?
In my short statement, at least three subjects may have been expecting the argument (concatenate, repeat, and tuple), and without the S in SVO, the identity of the subject that is disappointed by my failure to provide 1 positional argument is ambiguous.
Based on my literal thousands of hours of writing and editing training at law school with the best legal writing program in the US, if not the world, based on my experience as a teacher, and based on my many years of investigating the issue, a non-professional writer will get the most ROI by simply forcing themselves to always write with SVO unless they can articulate a great reason to not use SVO.
Just SVO. It is that simple. It is not necessarily an easy change, but the goal is simple: SVO, always.