Skip to content

Commit ce2d7fe

Browse files
committed
Python: Improve QLDoc for Arguments
1 parent 12f264c commit ce2d7fe

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

python/ql/src/semmle/python/Function.qll

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ class Parameter extends Parameter_ {
258258
/** An expression that generates a callable object, either a function expression or a lambda */
259259
abstract class CallableExpr extends Expr {
260260
/**
261-
* Gets the parameters of this callable.
261+
* Gets The default values and annotations (type-hints) for the arguments of this callable.
262+
*
262263
* This predicate is called getArgs(), rather than getParameters() for compatibility with Python's AST module.
263264
*/
264265
abstract Arguments getArgs();
@@ -314,7 +315,12 @@ class Lambda extends Lambda_, CallableExpr {
314315
override Arguments getArgs() { result = Lambda_.super.getArgs() }
315316
}
316317

317-
/** The arguments in a function definition */
318+
/**
319+
* The default values and annotations (type hints) for the arguments in a function definition.
320+
*
321+
* Annotations (PEP 3107) is a general mechanism for providing annotations for a function,
322+
* that is generally only used for type hints today (PEP 484).
323+
*/
318324
class Arguments extends Arguments_ {
319325
Expr getASubExpression() {
320326
result = this.getAKwDefault() or

0 commit comments

Comments
 (0)