Skip to content

Missing argument to Callable crashes mypy #673

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

Closed
spkersten opened this issue May 14, 2015 · 3 comments
Closed

Missing argument to Callable crashes mypy #673

spkersten opened this issue May 14, 2015 · 3 comments
Labels
bug mypy got something wrong

Comments

@spkersten
Copy link
Contributor

This code (missing return type in Callable) crashes mypy with an uncaught IndexError:

from typing import Callable

def g(f: Callable[[int]]) -> None:
    pass

It should just report an error.

@JukkaL JukkaL added the bug mypy got something wrong label May 15, 2015
@JukkaL
Copy link
Collaborator

JukkaL commented May 15, 2015

Yes, it definitely should not crash. Thanks for the bug report!

@gvanrossum
Copy link
Member

FWIW bare Callable it should probably be equivalent to Callable[..., Any]. See python/typing#133

@JukkaL
Copy link
Collaborator

JukkaL commented Jun 3, 2016

This no longer crashes.

@JukkaL JukkaL closed this as completed Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

3 participants