mirror of
https://github.com/python/cpython.git
synced 2025-07-13 14:25:18 +00:00
Correct the order of application for decorators. Meant to be bottom-up and not
top-down. Now matches the PEP.
This commit is contained in:
parent
31f8350f43
commit
add33601c2
3 changed files with 23 additions and 8 deletions
|
@ -4132,7 +4132,10 @@ com_decorators(struct compiling *c, node *n)
|
|||
REQ(CHILD(n, nch - 1), NEWLINE);
|
||||
|
||||
ndecorators = 0;
|
||||
for (i = NCH(n) - 1; i >= 0; --i) {
|
||||
/* the application order for decorators is the reverse of how they are
|
||||
listed; bottom-up */
|
||||
nch -= 1;
|
||||
for (i = 0; i < nch; i+=1) {
|
||||
node *ch = CHILD(n, i);
|
||||
if (TYPE(ch) != NEWLINE) {
|
||||
com_decorator(c, ch);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue