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

pinfer does a poor job with @overload-decorated methods #303

Closed
gvanrossum opened this issue Jul 18, 2014 · 1 comment
Closed

pinfer does a poor job with @overload-decorated methods #303

gvanrossum opened this issue Jul 18, 2014 · 1 comment
Labels
bug mypy got something wrong

Comments

@gvanrossum
Copy link
Member

Input:

class LazyList(Iterator[T], ...):
    @overload
    def __getitem__(self, arg: int): ...
    @overload
    def __getitem__(self, arg: slice): ...

Output:

class LazyList(...):
    def __getitem__(args: Either[LazyList, int]) -> int

Note that the inferred type is missing a 'self'. It is also missing a '*' in front of 'args'.

@JukkaL JukkaL removed the hackmypy label Jul 25, 2014
JelleZijlstra added a commit to JelleZijlstra/mypy that referenced this issue May 14, 2018
ilevkivskyi pushed a commit that referenced this issue May 14, 2018
@JukkaL
Copy link
Collaborator

JukkaL commented May 17, 2018

Pinfer was removed recently so this is no longer relevant.

@JukkaL JukkaL closed this as completed May 17, 2018
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

2 participants