We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
getClassName
1 parent 55744b6 commit 9baa262Copy full SHA for 9baa262
1 file changed
python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll
@@ -2158,6 +2158,23 @@ module DuckTyping {
2158
or
2159
f.getADecorator().(Name).getId() = "property"
2160
}
2161
+
2162
+ /** Gets the name of the builtin class of the immutable literal `lit`. */
2163
+ string getClassName(ImmutableLiteral lit) {
2164
+ lit instanceof IntegerLiteral and result = "int"
2165
+ or
2166
+ lit instanceof FloatLiteral and result = "float"
2167
2168
+ lit instanceof ImaginaryLiteral and result = "complex"
2169
2170
+ lit instanceof NegativeIntegerLiteral and result = "int"
2171
2172
+ lit instanceof StringLiteral and result = "str"
2173
2174
+ lit instanceof BooleanLiteral and result = "bool"
2175
2176
+ lit instanceof None and result = "NoneType"
2177
+ }
2178
2179
2180
/**
0 commit comments