GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — stubtest: don't crash when a classmethod's first parameter isn't named cls by HuzaifaChaudary · Pull Request #21941 · python/mypy Conversation
Contributor
fixes #16583 the first parameter of a classmethod can be called anything . networkx really does write that is not a normal stubtest error , it stops the whole run , so one oddly named parameter the name is never used for anything . the line right under it drops the argument by position , while testing i found a second way onto the same line . a stub written two cases added to
small heads up , #21863 adds its own cases to
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…alled cls the first parameter of a classmethod can be named anything, and networkx really does write def construct(EdgeComponentAuxGraph, G). stubtest checked the name against a list of four and raised StubtestFailure when it did not match, which aborts the whole run rather than reporting an error, so one odd name takes out stub checking for a whole distribution. the name is never used, the argument is dropped positionally on the next line, so the check guarded nothing. it looks at the argument kind instead now. a stub written def f(*args) reached the same line and crashed too. there is nothing bound to drop in that case, and inspect.signature of the runtime classmethod keeps the star argument as well, so both sides already line up and it returns unchanged. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reviewers
Copilot code review
Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Uh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. stubtest raises an exception when aclassmethod's first parameter not named cls
Uh oh!
There was an error while loading. Please reload this page. 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. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |