Skip to content

There's a difference between TypeVar('T', bound=Callable) and TypeVar('T', bound=Callable[..., Any]) #1501

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
gvanrossum opened this issue May 6, 2016 · 1 comment

Comments

@gvanrossum
Copy link
Member

@rwbarton Any idea? I found this in our internal code base, haven't come up with a small repro yet. Plain Callable is supposed to mean the same as Callable[..., Any] but in this case it's apparently not the case. I had some code that gave a long list of errors when I used the shorter form. OTOH I had some other code where it worked...

@rwbarton
Copy link
Contributor

rwbarton commented May 7, 2016

I can reproduce this by making that change to test testBoundOnDecorator. Will investigate.

rwbarton added a commit to rwbarton/mypy that referenced this issue May 7, 2016
The old definition of Callable was the type of a function defined as

    def f(*args: Any, **kwargs: Any) -> Any: ...

which is not the form of a general function, only one that can accept
an arbitrary number of arguments.

Fixes python#1501.
gvanrossum pushed a commit that referenced this issue May 8, 2016
The old definition of Callable was the type of a function defined as

    def f(*args: Any, **kwargs: Any) -> Any: ...

which is not the form of a general function, only one that can accept
an arbitrary number of arguments.

Fixes #1501.
gvanrossum pushed a commit that referenced this issue May 28, 2016
The old definition of Callable was the type of a function defined as

    def f(*args: Any, **kwargs: Any) -> Any: ...

which is not the form of a general function, only one that can accept
an arbitrary number of arguments.

Fixes #1501.
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