Skip to content

Check the type of self when accessing a method via instance #126

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
JukkaL opened this issue Feb 11, 2013 · 1 comment
Closed

Check the type of self when accessing a method via instance #126

JukkaL opened this issue Feb 11, 2013 · 1 comment
Labels
bug mypy got something wrong

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Feb 11, 2013

When creating a bound method object in statically typed code, the type checker should complain if the type of the method self argument is not compatible with the receiver. For example, this should be an error:

class A:
    def f(o: int) -> None: pass
A().f    # receiver is A, self is int: not compatible

The issue #16 is related.

@ghost ghost assigned JukkaL Feb 11, 2013
@JukkaL JukkaL removed the front end label Jul 25, 2014
@JukkaL JukkaL removed their assignment Jul 25, 2014
@gvanrossum
Copy link
Member

I think what's left of this is #16.

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