Skip to content

Commit f2bad1e

Browse files
committed
Python: Improve docstring and make predicate private
1 parent 66ca10c commit f2bad1e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,12 @@ predicate hasContextmanagerDecorator(Function func) {
308308
* Holds if the function `func` has a `typing.overload` decorator.
309309
* Such functions are type stubs that declare an overload signature but are
310310
* not the actual implementation.
311+
*
312+
* Normally we would want to model this using API graphs for more precision, but since this
313+
* predicate is used in the call graph computation, we have to use a more syntactic approach.
311314
*/
312315
overlay[local]
313-
predicate hasOverloadDecorator(Function func) {
316+
private predicate hasOverloadDecorator(Function func) {
314317
exists(ControlFlowNode overload |
315318
overload.(NameNode).getId() = "overload" and overload.(NameNode).isGlobal()
316319
or

0 commit comments

Comments
 (0)