Skip to content

Object attribute LSP violation #2747

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
roganov opened this issue Jan 23, 2017 · 2 comments
Closed

Object attribute LSP violation #2747

roganov opened this issue Jan 23, 2017 · 2 comments

Comments

@roganov
Copy link

roganov commented Jan 23, 2017

MyPy should error if subclass is not compatible with its base class.

class A:
    x = None  # type: int

class B(A):
    x = None  # type: str
@gvanrossum
Copy link
Member

gvanrossum commented Jan 23, 2017 via email

@roganov
Copy link
Author

roganov commented Jan 23, 2017

Sorry, couldn't find relevant issue. Closing.

@roganov roganov closed this as completed Jan 23, 2017
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