Python API: Add ClassValue.getABaseType()

This commit is contained in:
Mark Shannon
2019-08-15 10:26:03 +01:00
parent 6c6e35f541
commit 45f5825b47

View File

@@ -322,11 +322,7 @@ class ClassValue extends Value {
/** Gets an improper super type of this class. */
ClassValue getASuperType() {
result = this.getBaseType(_)
or
result = this.getASuperType().getBaseType(_)
or
result = this
result = this.getABaseType*()
}
/** Looks up the attribute `name` on this class.
@@ -371,6 +367,11 @@ class ClassValue extends Value {
result = Types::getBase(this, n)
}
/** Gets a base class of this class */
ClassValue getABaseType() {
result = Types::getBase(this, _)
}
/** Holds if this class is a new style class.
A new style class is one that implicitly or explicitly inherits from `object`. */
predicate isNewStyle() {