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

Use of Any as a value expression should be flagged as error #6144

Closed
erictraut opened this issue Oct 13, 2023 · 1 comment
Closed

Use of Any as a value expression should be flagged as error #6144

erictraut opened this issue Oct 13, 2023 · 1 comment
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working

Comments

@erictraut
Copy link
Collaborator

When Any is used outside of a type annotation in a regular value expression, it should be treated as a normal object for purposes of type checking. The following should generate an error, but does not currently:

from typing import Any

def func() -> int:
    return Any # Should generate an error
@erictraut
Copy link
Collaborator Author

This is included in pyright 1.1.332, which I just published. It will also be included in a future release of pylance.

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

1 participant