mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
Default values for positional arugments follow a rule, so if an argument has a
default value, later positional arguments must also have default values.
The database only stores the actual default values, and nothing about the
arguments that doesn't have default values.
This turns out to be a major problem for Argument.getKwDefault(i), since default
values for keyword-only arguments doesn't have the same rule. So if you know
there is one default value, you can't tell if it is associated with `foo` or
`bar`, as in the examples below:
```
def a(*, foo=None, bar):
pass
def b(*, foo, bar=None):
pass
```
5 lines
87 B
Plaintext
5 lines
87 B
Plaintext
import python
|
|
|
|
from FunctionExpr fe, int i
|
|
select fe, i, fe.getArgs().getAnnotation(i)
|