[New-bugs-announce] [issue9904] Cosmetic issues that might be worthy a fix in symtable.h/c
report at bugs.python.org
Mon Sep 20 08:29:06 CEST 2010
New submission from Eli Bendersky <eliben at gmail.com>:
The following minor issues may affect the readability of the code implementing symbol tables in Include/symtable.h and Python/symtable.c
* The comment for st_global in symtable.h says: "borrowed ref to st_top->st_symbols. typo? (st_top->ste_symbols)
* ste_varnames: the name and the comment after it are misleading, since it actually collects only the function's parameters and not all variables.
* the st_nblocks and st_future fields of symtable aren't used anywhere - py3k compiles fine when they're removed.
* in analyze_block a comment says "Recursively call analyze_block()" - untrue, probably meant analyze_child_block. While technically analyze_child_block calls analyze_block, the comment as-is appears misleading.
* symtable_add_def is also called with the USE flag, not only definitions, hence its name doesn't reflect its purpose accurately
* There are some indentation artifacts that obscure readability. For example the case Raise_kind of symtable_visit_stmt, where two nested blocks start and end in the same column obscuring the fact they're nested. This could be a result of an automatic tab to space conversion in the past.
components: Interpreter Core
nosy: eli.bendersky, ncoghlan
title: Cosmetic issues that might be worthy a fix in symtable.h/c
versions: Python 3.2
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce