[issue3563] fix_idioms.py generates bad code

2009-10-07 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Thanks very much for the patch; Committed in r75278. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3563

[issue3563] fix_idioms.py generates bad code

2009-10-06 Thread Joe Amenta
Joe Amenta ament...@msu.edu added the comment: Attached a patch that implements more thoroughly what appears to be the intended behavior. -- nosy: +joe.amenta Added file: http://bugs.python.org/file15061/fix_idioms.patch ___ Python tracker

[issue3563] fix_idioms.py generates bad code

2009-10-06 Thread Joe Amenta
Changes by Joe Amenta ament...@msu.edu: Removed file: http://bugs.python.org/file15061/fix_idioms.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3563 ___

[issue3563] fix_idioms.py generates bad code

2009-10-06 Thread Joe Amenta
Joe Amenta ament...@msu.edu added the comment: Missed a paren in the last one... re-uploading it. -- Added file: http://bugs.python.org/file15062/fix_idioms.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3563

[issue3563] fix_idioms.py generates bad code

2009-10-06 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- assignee: collinwinter - benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3563 ___

[issue3563] fix_idioms.py generates bad code

2008-12-08 Thread Armin Ronacher
Armin Ronacher [EMAIL PROTECTED] added the comment: I would drop the prefix in that case or attach it to the sorted() call. So from this code: x = foo() # perform sorting x.sort() to # perform sorting x = sorted(foo()) Makes more sense than sticking it after the sorted()

[issue3563] fix_idioms.py generates bad code

2008-08-22 Thread Terry J. Reedy
Terry J. Reedy [EMAIL PROTECTED] added the comment: Why is the statement, whatever it is, even being touched? Would not the same problem arise with any following outdented line? IOW, why not delete that pair of lines from fix_idioms.py? Does that break anything else in test_fixers? --

[issue3563] fix_idioms.py generates bad code

2008-08-16 Thread Ali Polatel
New submission from Ali Polatel [EMAIL PROTECTED]: fix_idioms.py generates bad code for conversions in try/except blocks. Example: s=(1, 2, 3) try: t = list(s) t.sort() except TypeError: pass fix_idioms.py generates this diff: --- test.py (original) +++ test.py (refactored) @@ -7,8

[issue3563] fix_idioms.py generates bad code

2008-08-16 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: It's due to these lines in fix_idioms: if next_stmt: next_stmt[0].set_prefix(sort_stmt.get_prefix()) I'm not sure what the correct way to deal with this is. Anyway I'm attaching a test case. -- keywords: +patch nosy: