Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5d9d724

Browse files
committed
Removes conflicting NumericValue definition
1 parent 28be3b4 commit 5d9d724

1 file changed

Lines changed: 0 additions & 56 deletions

File tree

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

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -144,62 +144,6 @@ class Value extends TObject {
144144
}
145145
}
146146

147-
/** Numeric values (ints and floats).
148-
* Includes those occurring in the source as a literal
149-
* or in a builtin module as a value.
150-
*/
151-
class NumericValue extends Value {
152-
153-
NumericValue() {
154-
this.asBuiltin().getClass() = theIntType().asBuiltin() or
155-
this.asBuiltin().getClass() = theLongType().asBuiltin() or
156-
this.asBuiltin().getClass() = theFloatType().asBuiltin()
157-
}
158-
159-
/** Gets the Boolean value that this object
160-
* would evaluate to in a Boolean context,
161-
* such as `bool(x)` or `if x: ...`
162-
*/
163-
override boolean booleanValue() {
164-
this.intValue() != 0 and result = true
165-
or
166-
this.intValue() = 0 and result = false
167-
or
168-
this.floatValue() != 0 and result = true
169-
or
170-
this.floatValue() = 0 and result = false
171-
}
172-
173-
/** Gets the value of this object if it is a constant integer and it fits in a QL int */
174-
int intValue() {
175-
(
176-
this.asBuiltin().getClass() = theIntType().asBuiltin() or
177-
this.asBuiltin().getClass() = theLongType().asBuiltin()
178-
)
179-
and
180-
result = this.asBuiltin().getName().toInt()
181-
}
182-
183-
/** Gets the value of this object if it is a constant float */
184-
float floatValue() {
185-
this.asBuiltin().getClass() = theFloatType().asBuiltin()
186-
and
187-
result = this.asBuiltin().getName().toFloat()
188-
}
189-
190-
/** Gets the string representation of this object, equivalent to calling repr() in Python */
191-
string repr() {
192-
exists(string s |
193-
s = this.asBuiltin().getName() |
194-
if this.asBuiltin().getClass() = theLongType().asBuiltin() then
195-
result = s + "L"
196-
else
197-
result = s
198-
)
199-
}
200-
201-
}
202-
203147
/** Class representing modules in the Python program
204148
* Each `ModuleValue` represents a module object in the Python program.
205149
*/

0 commit comments

Comments
 (0)