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

Pylint raises error saying "default" isn't valid for TypeVar #411

Closed
nfelt14 opened this issue May 24, 2024 · 2 comments
Closed

Pylint raises error saying "default" isn't valid for TypeVar #411

nfelt14 opened this issue May 24, 2024 · 2 comments

Comments

@nfelt14
Copy link

nfelt14 commented May 24, 2024

After upgrading to 4.12.0, pylint is raising the following error for TypeVars that have default values:

E1123: Unexpected keyword argument 'default' in constructor call (unexpected-keyword-arg)

The same code does not raise an error when using 4.11.0.

@JelleZijlstra
Copy link
Member

Sounds like you found a bug in pylint. I don't know how pylint decides what keyword arguments a constructor call accepts, but typing_extensions.TypeVar definitely accepts default=.

Could you report this to pylint first? If there's some way we could write our code that makes pylint's job easier, I would consider it, but I have no idea what it's looking at.

@nfelt14
Copy link
Author

nfelt14 commented May 24, 2024

Sounds like you found a bug in pylint. I don't know how pylint decides what keyword arguments a constructor call accepts, but typing_extensions.TypeVar definitely accepts default=.

Could you report this to pylint first? If there's some way we could write our code that makes pylint's job easier, I would consider it, but I have no idea what it's looking at.

I will do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants