mirror of
https://github.com/python/cpython.git
synced 2025-09-14 04:37:29 +00:00
prevent lambda functions from having docstrings #8164
This commit is contained in:
parent
78c1871d21
commit
0dee9c1b5c
3 changed files with 11 additions and 0 deletions
|
@ -1518,6 +1518,11 @@ compiler_lambda(struct compiler *c, expr_ty e)
|
|||
|
||||
/* unpack nested arguments */
|
||||
compiler_arguments(c, args);
|
||||
|
||||
/* Make None the first constant, so the lambda can't have a
|
||||
docstring. */
|
||||
if (compiler_add_o(c, c->u->u_consts, Py_None) < 0)
|
||||
return 0;
|
||||
|
||||
c->u->u_argcount = asdl_seq_LEN(args->args);
|
||||
VISIT_IN_SCOPE(c, expr, e->v.Lambda.body);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue