Skip to content

Commit 7af5f03

Browse files
committed
Python: Add missing override to ClassValue.hasAttribute
I was considering if this was actually something different than Value.hasAttribute, and the names were just accidentially the same. But after looking at the definition for Value, I'm happy about marking this as an override (I did not test whether it was neede though): ```codeql class Value extends TObject { ... /** Holds if this value has the attribute `name` */ predicate hasAttribute(string name) { this.(ObjectInternal).hasAttribute(name) } ```
1 parent 6685a5e commit 7af5f03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,10 @@ class ClassValue extends Value {
540540
Value declaredAttribute(string name) { Types::declaredAttribute(this, name, result, _) }
541541

542542
/**
543-
* Holds if this class has the attribute `name`, including
544-
* attributes declared by super classes.
543+
* Holds if this class has the attribute `name`, including attributes
544+
* declared by super classes.
545545
*/
546-
predicate hasAttribute(string name) { this.getMro().declares(name) }
546+
override predicate hasAttribute(string name) { this.getMro().declares(name) }
547547

548548
/**
549549
* Holds if this class declares the attribute `name`,

0 commit comments

Comments
 (0)