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 <rep...@bugs.python.org>
<http://bugs.python.org/issue25670>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to