[Patches] [ python-Patches-1095541 ] fix for trivial flatten bug in astgen

SourceForge.net noreply at sourceforge.net
Sun Mar 20 22:09:21 CET 2005


Patches item #1095541, was opened at 2005-01-04 00:15
Message generated for change (Settings changed) made by bcannon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1095541&group_id=5470

Category: Parser/Compiler
>Group: AST
Status: Open
Resolution: None
Priority: 5
Submitted By: DSM (dsm001)
>Assigned to: Brett Cannon (bcannon)
Summary: fix for trivial flatten bug in astgen

Initial Comment:
The flatten in compiler.ast (from astgen) doesn't work
for sublists, although the source shows it tries to:

>>> compiler.ast.flatten([1,2,(3,4)])
[1, 2, 3, 4]

>>> compiler.ast.flatten([1,2,[3,4]])
[1, 2, [3, 4]]

The dangers of calling your lists 'list'.. (type is
list check fails.)  A brief glance suggests it gets
called with tuples instead so I don't think the bug has
any obvious consequences.

----------------------------------------------------------------------

Comment By: Björn Lindqvist (sonderblade)
Date: 2005-02-11 19:00

Message:
Logged In: YES 
user_id=51702

The patch works but it would be nice if there was a test in
test_compiler.py that checks for correctness of the flattens
too.  

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1095541&group_id=5470


More information about the Patches mailing list