[New-bugs-announce] [issue25670] ast.NodeTransformer: remove duplicate getattr()

STINNER Victor report at bugs.python.org
Thu Nov 19 10:11:04 EST 2015


New submission from STINNER Victor:

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.

----------
files: node_transformer.patch
keywords: patch
messages: 254903
nosy: haypo
priority: normal
severity: normal
status: open
title: ast.NodeTransformer: remove duplicate getattr()
type: performance
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41078/node_transformer.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25670>
_______________________________________


More information about the New-bugs-announce mailing list