-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve known metaclass base class detection
We previously only looked for known metaclass base classes that were inheriting using the simple `ast.Name` syntax: class Meta(type): pass class Meta(ABCMeta): pass We weren't accounting for the `ast.Attribute` syntax: class Meta(abc.ABCMeta): pass This second syntax will now also match `ABCMeta` and be recognized as a metaclass base class. We could alternatively add `abc.ABCMeta` to METACLASS_BASES and construct the fully-qualified name of each base class that uses the `ast.Attribute` syntax. The simpler approach used here is currently unambiguous, so we'll start with this.
- Loading branch information
Showing
2 changed files
with
17 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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