-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
pylint-2.5.0 cannot parse a class overriding JSONEncoder's default method #3527
Comments
PCManticore
added a commit
that referenced
this issue
Apr 28, 2020
The patch replaces `mro()` with `ancestors()` as the former is not fully capable of generating the complete linearization when dealing with ambiguous inferences. Close #3527
PCManticore
added a commit
that referenced
this issue
Apr 28, 2020
The patch replaces `mro()` with `ancestors()` as the former is not fully capable of generating the complete linearization when dealing with ambiguous inferences. Close #3527
Handled by #3532. Thank you for the report! We'll release 2.5.1 in the following days with the most urgent patches. |
PCManticore
added a commit
that referenced
this issue
Apr 28, 2020
The patch replaces `mro()` with `ancestors()` as the former is not fully capable of generating the complete linearization when dealing with ambiguous inferences. Close #3527
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Thanks a lot for all your work on pylint and the related projects!
There have been previous issues raised about pylint's handling of classes that inherit from json.JSONEncoder and override its .default() method, mostly because JSONEncoder is woefully special in having a "default" propertyfor its constructor and then doing something crazy with it. However, at least the previously-reported issues I could find (e.g. #414) are kind of solved by disabling the method-hidden diagnostics for the default() method.
Now it seems that pylint-2.5.0 cannot even parse such a class.
Steps to reproduce
python3 -m tox -e python_lint_3
and watch it breakFor the record, yes, I know that we are doing some pretty horrible things in the JsonObjectImpl class, and we are in the process of redesigning the StorPool Python bindings in a much saner way, but the current version seems to work with pylint-2.4.4.
I am sorry that I could not provide a smaller testcase, but a couple of attempts at simplfiying this failed - pylint did not break on the much simpler versions. I could try harder to provide a simpler test case if it will make your task easier.
Current behavior
Expected behavior
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
pylint --version output
Thanks in advance for your time, and keep up the great work!
G'luck,
Peter
The text was updated successfully, but these errors were encountered: