Files
codeql/python/ql/test/library-tests/descriptors/Properties.ql
Rasmus Wriedt Larsen 67e9edb820 Python: Add PropertyValue
+ Extend PropertyInternal.getSetter to handle non-decorator
+ Add PropertyInternal.getDeleter

It seems like a bit hacky way to do things, since we're not using the
PropertySetterOrDeleter class at all, but for now I'll leave it be.
2020-02-19 14:12:22 +01:00

12 lines
331 B
Plaintext

import python
import semmle.python.types.Descriptors
from PropertyValue p, string method_name, FunctionValue method
where
method_name = "getter" and method = p.getGetter()
or
method_name = "setter" and method = p.getSetter()
or
method_name = "deleter" and method = p.getDeleter()
select method, method_name, p