This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: fix for trivial flatten bug in astgen
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: nascheme Nosy List: brett.cannon, dsm001, nascheme, sonderblade
Priority: normal Keywords: patch

Created on 2005-01-04 08:15 by dsm001, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fixflat.patch dsm001, 2005-01-04 08:15 fix broken type is list check
Messages (4)
msg47465 - (view) Author: DSM (dsm001) Date: 2005-01-04 08:15
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.
msg47466 - (view) Author: Björn Lindqvist (sonderblade) Date: 2005-02-12 03:00
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.  
msg47467 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2005-04-13 20:06
Logged In: YES 
user_id=357491

Accidentally assigned this as an AST patch when it actuality
it is for the compiler package.

Fixed to be the proper group and assigned to Jeremy.
msg47468 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2005-06-02 05:55
Logged In: YES 
user_id=35752

Checked in along with a little test.
History
Date User Action Args
2022-04-11 14:56:09adminsetgithub: 41394
2005-01-04 08:15:28dsm001create