mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Python: Expand implicit classmethods
This commit is contained in:
@@ -197,7 +197,11 @@ predicate isClassmethod(Function func) {
|
|||||||
or
|
or
|
||||||
exists(Class cls |
|
exists(Class cls |
|
||||||
cls.getAMethod() = func and
|
cls.getAMethod() = func and
|
||||||
func.getName() = "__new__"
|
func.getName() in [
|
||||||
|
"__new__", // https://docs.python.org/3.10/reference/datamodel.html#object.__new__
|
||||||
|
"__init_subclass__", // https://docs.python.org/3.10/reference/datamodel.html#object.__init_subclass__
|
||||||
|
"__class_getitem__", // https://docs.python.org/3.10/reference/datamodel.html#object.__class_getitem__
|
||||||
|
]
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user