Skip to content

Unable to silence generic type arg count errors #1404

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
smallnamespace opened this issue Apr 18, 2016 · 2 comments
Closed

Unable to silence generic type arg count errors #1404

smallnamespace opened this issue Apr 18, 2016 · 2 comments
Assignees
Labels
bug mypy got something wrong

Comments

@smallnamespace
Copy link

smallnamespace commented Apr 18, 2016

I expect to be able to silence errors relating to number of type args in generic types, but I can't.

This piece of code

from typing import Iterable, no_type_check


@no_type_check
class Foo(Iterable[int, float]):  # type: ignore
    pass

results in

mypy.py:5: error: "Iterable" expects 1 type argument, but 2 given

even though I've used both @no_type_check and # type: ignore.

Note that I'm purposefully passing in the wrong number of generic args (to a custom generic subclass, obviously, not to Iterable) in order to work around #1304, since the typing.py fix hasn't filtered out yet.

@gvanrossum gvanrossum added this to the 0.4 milestone Apr 28, 2016
@ddfisher ddfisher self-assigned this Apr 28, 2016
@JukkaL JukkaL added the bug mypy got something wrong label Apr 29, 2016
@JukkaL
Copy link
Collaborator

JukkaL commented Apr 29, 2016

Also, Iterable[int, float] should probably be understood as Iterable[Any] internally.

@ddfisher
Copy link
Collaborator

ddfisher commented May 3, 2016

Looks like this was fixed by e6ba756.

@ddfisher ddfisher closed this as completed May 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

4 participants