Python: Extend API a bit.

This commit is contained in:
Mark Shannon
2019-04-05 08:59:58 +01:00
parent 31a95ceeec
commit 3c30480845

View File

@@ -104,6 +104,18 @@ module Module {
}
module Value {
Value named(string name) {
exists(string modname, string attrname |
name = modname + "." + attrname |
result = Module::named(modname).attr(attrname)
)
or
result = ObjectInternal::builtin(name)
}
}
class CallableValue extends Value {
@@ -124,5 +136,10 @@ class ClassValue extends Value {
this.(ObjectInternal).isClass() = true
}
/** Gets an improper super type of this class. */
ClassValue getASuperType() {
result = Types::getMro(this).getAnItem()
}
}