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

reportArgumentType when passing type annotated parameter to super() #7931

Closed
peterschutt opened this issue May 16, 2024 · 2 comments
Closed
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working

Comments

@peterschutt
Copy link

Describe the bug
Calling super with a parameter annotated as type such as:

def fn(t: type) -> super:
    return super(t, t)


class MyClass:
    pass


fn(MyClass)

Results in:

test.py:3:18 - error: Expected class type as first argument to "super" call but received "type" (reportArgumentType)
1 error, 0 warnings, 0 informations 

VS Code extension or command-line
CLI

@peterschutt peterschutt added the bug Something isn't working label May 16, 2024
@erictraut erictraut added the addressed in next version Issue is fixed and will appear in next published version label May 16, 2024
erictraut added a commit that referenced this issue May 16, 2024
…to `super` call is an instance of a metaclass. This addresses #7931.
@erictraut
Copy link
Collaborator

This is addressed in pyright 1.1.364.

@peterschutt
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants