GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `networkx.algorithms.connectivity.edge_kcomponents.EdgeComponentAuxGraph.construct` first param is not `cls` at runtime by Avasam · Pull Request #13587 · python/typeshed

Conversation

@Avasam

@Avasam Avasam commented Mar 6, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Mainly just testing if the following mypy/stubtest issue is solved: python/mypy#16583

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Avasam added 2 commits March 5, 2025 22:14
@Avasam
EdgeComponentAuxGraph.construct first param is not cls at runtime
07f2838
@Avasam
Fix Self import
ae70c0f
@Avasam Avasam mentioned this pull request Mar 6, 2025
stubtest raises an exception when a classmethod's first parameter not named cls python/mypy#16583
Closed
@Avasam Avasam closed this Mar 6, 2025
@github-actions

github-actions Bot commented Mar 6, 2025

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@HuzaifaChaudary HuzaifaChaudary mentioned this pull request Sep 4, 2026
stubtest: don't crash when a classmethod's first parameter isn't named cls python/mypy#21941
Merged
JelleZijlstra pushed a commit to python/mypy that referenced this pull request Oct 19, 2026
@HuzaifaChaudary
stubtest: don't crash when a classmethod's first parameter isn't name…
d21cf1b
…d cls (#21941)

fixes #16583

the first parameter of a classmethod can be called anything . networkx
really does write
`def construct(EdgeComponentAuxGraph, G)` . stubtest checked that name
against a list of four
and raised `StubtestFailure` when it did not match :

```
StubtestFailure: unexpected class parameter name 'EdgeComponentAuxGraph' in pkg.EdgeComponentAuxGraph.construct
```

that is not a normal stubtest error , it stops the whole run , so one
oddly named parameter
takes out stub checking for a whole distribution . that is what happens
on
python/typeshed#13587 .

the name is never used for anything . the line right under it drops the
argument by position ,
so the check was not guarding the code below it . it looks at the
argument kind now instead .

while testing i found a second way onto the same line . a stub written
`def f(*args)` under
`@classmethod` also crashed . there is nothing bound to drop in that
case , and
`inspect.signature` of the runtime classmethod keeps the star argument
too , so both sides
already match and it returns unchanged . dropping it would have made a
false mismatch .

two cases added to `test_static_class_method` , one for the odd name and
one for `*args` .
both fail on master with the crash above .

`teststubtest.py` and `teststubgen.py` give 440 passed , 1 skipped , 2
xfailed . self check
on the two files is clean , and so are black and ruff .

small heads up , #21863 adds its own cases to `test_static_class_method`
starting on the same
line , so whichever goes in second will need a rebase . it is only the
test file , that one
changes `verify_var` and this one changes
`_resolve_funcitem_from_decorator` , so they do not
touch the same code .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Avasam
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.