Modernize inconsistent equality

This commit is contained in:
Joe Farebrother
2025-07-08 15:33:59 +01:00
parent 4c5c4e06c3
commit eb1b5a35d7
6 changed files with 92 additions and 54 deletions

View File

@@ -91,6 +91,12 @@ class Class extends Class_, Scope, AstNode {
/** Gets a method defined in this class */
Function getAMethod() { result.getScope() = this }
/** Gets the method defined in this class with the specified name, if any. */
Function getMethod(string name) {
result = this.getAMethod() and
result.getName() = name
}
override Location getLocation() { py_scope_location(result, this) }
/** Gets the scope (module, class or function) in which this class is defined */