mirror of
https://github.com/github/codeql.git
synced 2026-05-04 21:25:44 +02:00
Python: Extend API a bit.
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user