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
Catch MRO error when applying missing hints feature. #4688
Conversation
I had a feeling this was something we had to fix in astroid, but no tests seems to fail when simply catching the exception. Do you have an opinion @cdce8p ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this fix :) ! Could you add the example you gave in the issue in tests/functionals/r/regression/regression_mro_error.py
?
# pylint: disable=missing-docstring,pointless-statement,useless-object-inheritance
class Klass(object, object):
def get(self):
self._non_existent_attribute [no-member]
If it's not working we'll have to modify astroid and release a new version.
Hey, I added the required tests. Thanks :) |
tests/functional/r/regression/regression_4688_duplicated_bases_member_hints.txt
Outdated
Show resolved
Hide resolved
…_member_hints.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test was failing because you're probably on python 3.7 and we do not check the column in the tests for python 3.7 because the ast got different and better in 3.8. Thanks for fixing this crash, you're helping us release 2.9.4 faster !
Congratulation on becoming a pylint contributor, especially on such an important issue, the fast crash fixes after a new release are very stressful as maintainer <3 ! |
Steps
doc/whatsnew/<current release.rst>
.Description
This fixes #4687.
Missing type hints won't fail hard anymore when applied to an instance with an MRO with duplicated names.
Type of Changes
Related Issue
Closes #4687