Skip to content

Commit 7e6f0b0

Browse files
yoffRasmusWL
andauthored
Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
1 parent 478cfd7 commit 7e6f0b0

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

python/ql/src/experimental/dataflow/internal/DataFlowPrivate.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ private Node update(Node node) {
255255
* extra positional argument to this node.
256256
*
257257
* CURRENTLY NOT SUPPORTED:
258-
* When a call contains a tuple argument, it is expanded into positional arguments.
258+
* When a call contains an iterable unpacking argument, such as `func(*args)`, it is expanded into positional arguments.
259259
*
260260
* CURRENTLY NOT SUPPORTED:
261-
* Whe a call contains a tuple argument and the callee contains a starred argument, any extra
261+
* When a call contains an iterable unpacking argument, such as `func(*args)`, and the callee contains a starred argument, any extra
262262
* positional arguments are passed to the starred argument.
263263
*
264264
* When a call contains keyword arguments that do not correspond to keyword parameters, these
@@ -273,15 +273,15 @@ private Node update(Node node) {
273273
* value. This is used as the argument passed to the matching keyword parameter. There is a read
274274
* step from the dictionary argument to the synthesized argument node.
275275
*
276-
* When a call contains a dictionary argument and the callee contains a doubly starred parameter,
276+
* When a call contains a dictionary unpacking argument, such as `func(**kwargs)`, and the callee contains a doubly starred parameter,
277277
* entries which are not unpacked are passed to the doubly starred parameter. This is achieved by
278278
* adding a dataflow step from the dictionary argument to `TKwOverflowNode(call, callable)` and a
279279
* step to clear content of that node at any unpacked keys.
280280
*
281281
* ## Examples:
282282
* Assume that we have the callable
283283
* ```python
284-
* def f(x, y, *t, *d):
284+
* def f(x, y, *t, **d):
285285
* pass
286286
* ```
287287
* Then the call

python/ql/test/experimental/dataflow/coverage/argumentPassing.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ def argument_passing(
5454
b,
5555
/,
5656
c,
57-
d="",
57+
d=arg4,
5858
*,
59-
e="",
59+
e=arg5,
6060
f,
6161
**g,
6262
):
@@ -70,8 +70,12 @@ def argument_passing(
7070

7171

7272
@expects(7)
73-
def test_argument_passing():
73+
def test_argument_passing1():
7474
argument_passing(arg1, *(arg2, arg3, arg4), e=arg5, **{"f": arg6, "g": arg7})
75+
76+
@expects(7)
77+
def test_argument_passing2():
78+
argument_passing(arg1, arg2, arg3, f=arg6)
7579

7680

7781
def with_pos_only(a, /, b):

0 commit comments

Comments
 (0)