Issue 25670: ast.NodeTransformer: remove duplicate getattr() (original) (raw)
Issue25670
Created on 2015-11-19 15:11 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Files | |||
---|---|---|---|
File name | Uploaded | Description | Edit |
node_transformer.patch | vstinner,2015-11-19 15:11 | review |
Messages (4) | ||
---|---|---|
msg254903 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2015-11-19 15:11 |
ast.NodeTransformer.generic_visit() calls getattr() whereas iter_fields() already returns the attribute. The getattr() is useless, attached patch removes it. Sadly, it looks like test_ast doesn't test this class at all :-( The class is tested *indirectly* by test_inspect. | ||
msg254911 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2015-11-19 16:32 |
Oh, the getattr() is as old as the Lib/ast.py module: change 7d824fd131ad. | ||
msg254935 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2015-11-19 20:53 |
LGTM! | ||
msg254954 - (view) | Author: Roundup Robot (python-dev) ![]() |
Date: 2015-11-20 07:51 |
New changeset 7789f338447f by Victor Stinner in branch '3.5': Issue #25670: Remove duplicate getattr() from ast.NodeTransformer https://hg.python.org/cpython/rev/7789f338447f New changeset 2d90f4b27743 by Victor Stinner in branch 'default': Merge 3.5 (issue #25670) https://hg.python.org/cpython/rev/2d90f4b27743 |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:24 | admin | set | github: 69856 |
2015-11-20 08:20:00 | vstinner | set | status: open -> closedresolution: fixed |
2015-11-20 07:51:16 | python-dev | set | nosy: + python-devmessages: + |
2015-11-19 20:53:43 | serhiy.storchaka | set | nosy: + serhiy.storchakamessages: + assignee: vstinnercomponents: + Library (Lib)stage: commit review |
2015-11-19 16:32:25 | vstinner | set | messages: + |
2015-11-19 15:11:04 | vstinner | create |