Skip to content

Commit bfb720c

Browse files
committed
Adds range and tuple types
1 parent 3ce250b commit bfb720c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

python/ql/src/semmle/python/objects/ObjectAPI.qll

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,11 +739,23 @@ module ClassValue {
739739
ClassValue float_() {
740740
result = TBuiltinClassObject(Builtin::special("float"))
741741
}
742-
742+
743+
/** Get the `ClassValue` for the `tuple` class. */
744+
ClassValue tupleType() {
745+
result = TBuiltinClassObject(Builtin::special("tuple"))
746+
}
747+
743748
/** Get the `ClassValue` for the `list` class. */
744749
ClassValue list() {
745750
result = TBuiltinClassObject(Builtin::special("list"))
746751
}
752+
753+
/** The builtin class '(x)range' */
754+
ClassValue rangeType() {
755+
result = TBuiltinClassObject(Builtin::special("xrange"))
756+
or
757+
major_version() = 3 and result = TBuiltinClassObject(Builtin::special("range"))
758+
}
747759

748760
/** Get the `ClassValue` for the `bytes` class (also called `str` in Python 2). */
749761
ClassValue bytes() {

0 commit comments

Comments
 (0)