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 — Add function definition notes for `missing_named_argument` errors by KevinRK29 · Pull Request #20794 · python/mypy

Conversation

@KevinRK29

@KevinRK29 KevinRK29 commented Feb 13, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Collaborator

This PR helps improve error messages for call argument errors by adding a note "foo" is defined in "bar" to indicates where that called function is defined
Currently we add it for this error:

  • missing named arguments

In later PRs, I will add this note to the following errors in separate iterations:

  • too few arguments
  • too many arguments
  • too many positional arguments

Sorry, something went wrong.

Uh oh!

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

All reactions
@KevinRK29
KevinRK29 requested a review from JukkaL February 13, 2026 07:49
@github-actions

This comment has been minimized.

Sign in to view
@ilevkivskyi

ilevkivskyi commented Feb 13, 2026

Copy link
Copy Markdown
Member

I don't know how much context @JukkaL gave you, but let's wait with this until I am done with my part of the work (switching to more standard message formatting for this note) first.

Also maybe we should not add it to so many places at once.

KevinRK29 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@ilevkivskyi

ilevkivskyi commented Feb 14, 2026

Copy link
Copy Markdown
Member

@KevinRK29 now that I merged #20808, you can consider following improvements:

  • Adding a second note with short list of other argument names that have the same type (e.g. user renamed position to coordinates but forgot the new name)
  • Adding this "foo" is defined in "bar" note in more places (split this over multiple PRs, and maybe even multiple releases, so that we don't add too much unwanted noise in a single release).
All reactions

Sorry, something went wrong.

Uh oh!

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

@KevinRK29

KevinRK29 commented Feb 18, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Collaborator Author

@ilevkivskyi sounds good, I can look into those. Also I agree, adding it in iterations would be better for the reasons you mentioned, and also because there's a quite a lot of test updates if we add it in all these places in one go I believe

Edit: seems like after rebasing with the changes included in the PR mentioned above, it scopes it only to when it's defined in a different module, so that helps reduce the number of tests needing to be updated by a lot 😅

All reactions

Sorry, something went wrong.

Uh oh!

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

@KevinRK29
extracted to make a helper function and added more usages
85996a7
@KevinRK29
KevinRK29 force-pushed the add-more-note-defined-messages branch from efec334 to 85996a7 Compare February 20, 2026 09:42
@KevinRK29
scope note to just missing_named_argument error
69b5533
@KevinRK29
KevinRK29 requested a review from ilevkivskyi February 20, 2026 09:51
@KevinRK29
update
b8e1d06
@github-actions

This comment has been minimized.

Sign in to view
@ilevkivskyi
ilevkivskyi marked this pull request as ready for review February 20, 2026 13:01
ilevkivskyi
ilevkivskyi approved these changes Feb 20, 2026
View reviewed changes
@KevinRK29
added test
b22f220
@KevinRK29

KevinRK29 commented Feb 20, 2026

Copy link
Copy Markdown
Collaborator Author

@ilevkivskyi I added a quick test as well for a sanity check on behaviour. Regarding adding this note for the other errors, what kind of cadence do you want me to make them, like when should I make the next PR for another error? I'm planning on adding the note to too_many_arguments last since i believe that brings the most noise from the options I mentioned.

All reactions

Sorry, something went wrong.

Uh oh!

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

@KevinRK29 KevinRK29 changed the title Add function definition notes for more call argument errors Add function definition notes for missing_named_argument errors Feb 20, 2026
@github-actions

github-actions Bot commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

All reactions

Sorry, something went wrong.

Uh oh!

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

@KevinRK29
KevinRK29 merged commit 837052e into python:master Feb 23, 2026
23 checks passed

Uh oh!

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

@KevinRK29 KevinRK29 mentioned this pull request May 5, 2026
Add function definition notes for too_many_positional_arguments errors #21410
Merged
JukkaL pushed a commit that referenced this pull request Jun 15, 2026
@KevinRK29
Add function definition notes for too_many_positional_arguments err…
0f9676e
…ors (#21410)

Followup to #20794

Adds the "foo" is defined in "bar" note for the
`too_many_positional_arguments ` error case

Also update some call-related errors to generate
`call-arg` error code (sub-code of `misc`) instead
of `misc`, for consistency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ilevkivskyi ilevkivskyi ilevkivskyi approved these changes
@JukkaL JukkaL Awaiting requested review from JukkaL

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.

2 participants

@KevinRK29 @ilevkivskyi
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.