Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected-keyword-arg: false positive and confusing error message with Uninferable #9983

Open
dseomn opened this issue Sep 28, 2024 · 0 comments
Labels
Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling

Comments

@dseomn
Copy link

dseomn commented Sep 28, 2024

Bug description

This code is triggering unexpected-keyword-arg, I think because pylint can't infer the value of name:

https://github.com/dseomn/rock-paper-sand/blob/b0cf620cee0cd118eb1b7ee34d15f9257d0fb3be/rock_paper_sand/media_filter_test.py#L391

registry = media_filter.Registry(**{f"{name}_factory": factory})

Configuration

No response

Command used

pylint rock_paper_sand

Pylint output

rock_paper_sand/media_filter_test.py:391:19: E1123: Unexpected keyword argument 'Uninferable_factory' in constructor call (unexpected-keyword-arg)

Expected behavior

Since pylint can't tell if the keyword arg is valid or not, I'd expect it to not complain.

Even if it does have a finding for this, the 'Uninferable_factory' in the error message is confusing, since (as far as I can tell) it's a combination of a value supplied by pylint (Uninferable) and the f-string in the code, but the actual code would never have a keyword arg with the name Uninferable_factory.

Pylint version

https://github.com/dseomn/rock-paper-sand/actions/runs/11061313391/job/30733661830 shows pylint 3.3.1, astroid 3.3.4, and python 3.12.6.

OS / Environment

No response

Additional dependencies

No response

@dseomn dseomn added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling
Projects
None yet
Development

No branches or pull requests

1 participant