Revert #893: Avoid setting a Call as a base for classes from six.with_metaclass()#1622
Merged
Pierre-Sassoulas merged 1 commit intopylint-dev:mainfrom Jun 23, 2022
Merged
Conversation
… from six.with_metaclass()
six.with_metaclass()six.with_metaclass()
Pull Request Test Coverage Report for Build 2503836953
💛 - Coveralls |
Contributor
|
@jacobtylerwalls @Pierre-Sassoulas i'm ok with this PR. |
Pierre-Sassoulas
approved these changes
Jun 23, 2022
adam-grant-hendry
pushed a commit
to adam-grant-hendry/astroid
that referenced
this pull request
Jun 23, 2022
… from six.with_metaclass() (pylint-dev#1622)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Steps
Description
#893 intended to fix a false positive for
unused-importofsixin a pattern likeclass Thing(six.with_metaclass(meta, ancestor))by making thenodes.Callcontainingsix.with_metaclassinto a base. Then, this violated assumptions elsewhere, leading to the crash in pylint-dev/pylint#5935.#893 was itself a partial reversion of #841, a fix for #713. #713 is essentially the same issue as pylint-dev/pylint#5935. So what I'm suggesting is that we revert to #841, and then find another way to deal with the
unused-importin pylint, if at all.(I'd much rather have a false positive than a crash. And the class of false positives is larger than anything to do with
six.with_metaclassanyway: see pylint-dev/pylint#1630. So we shouldn't treatsixas more special.)Let's not backport this, to give us time to make a decision about what to do in pylint with pylint-dev/pylint#1630.
Type of Changes
Related Issue
Refs pylint-dev/pylint#5935