[issue9147] dis.show_code() variant that accepts source strings (and returns rather than prints)
Nick Coghlan ncogh...@gmail.com added the comment: Implemented in r84133 -- resolution: - accepted stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9147 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9147] dis.show_code() variant that accepts source strings (and returns rather than prints)
Nick Coghlan ncogh...@gmail.com added the comment: Final name was dis.code_info() and it accepts functions, methods, code objects and source strings. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9147 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9147] dis.show_code() variant that accepts source strings (and returns rather than prints)
Florent Xicluna florent.xicl...@gmail.com added the comment: The buildbot XP-4 3.x fails on test_dis. http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.x/builds/2770 test_code_info (test.test_dis.CodeInfoTests) ... FAIL test_show_code (test.test_dis.CodeInfoTests) ... FAIL == FAIL: test_code_info (test.test_dis.CodeInfoTests) -- Traceback (most recent call last): File D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_dis.py, line 359, in test_code_info self.assertEqual(dis.code_info(x), expected) AssertionError: 'Name: tricky\nFilename: D:\\cygwin\\home\\db3l\\buildarea [truncated]... != 'Name: tricky\nFilename: D:\\cygwin\\home\\db3l\\buildarea [truncated]... Name: tricky Filename: D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_dis.py Argument count:3 Kw-only arguments: 3 Number of locals: 8 Stack size:7 Flags: OPTIMIZED, NEWLOCALS, VARARGS, VARKEYWORDS, GENERATOR Constants: 0: None -1: code object f at 0x03D750F8, file D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_dis.py, line 246 ? - ^ ^ +1: code object f at 0x3d750f8, file D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_dis.py, line 246 ?^ ^ Variable names: 0: x 1: y 2: z 3: c 4: d 5: e 6: args 7: kwds Cell variables: 0: e 1: d 2: f 3: y 4: x 5: z == FAIL: test_show_code (test.test_dis.CodeInfoTests) -- Traceback (most recent call last): File D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_dis.py, line 366, in test_show_code self.assertEqual(output.getvalue(), expected+\n) AssertionError: 'Name: tricky\nFilename: D:\\cygwin\\home\\db3l\\buildarea [truncated]... != 'Name: tricky\nFilename: D:\\cygwin\\home\\db3l\\buildarea [truncated]... Name: tricky Filename: D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_dis.py Argument count:3 Kw-only arguments: 3 Number of locals: 8 Stack size:7 Flags: OPTIMIZED, NEWLOCALS, VARARGS, VARKEYWORDS, GENERATOR Constants: 0: None -1: code object f at 0x03D750F8, file D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_dis.py, line 246 ? - ^ ^ +1: code object f at 0x3d750f8, file D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_dis.py, line 246 ?^ ^ Variable names: 0: x 1: y 2: z 3: c 4: d 5: e 6: args 7: kwds Cell variables: 0: e 1: d 2: f 3: y 4: x 5: z -- keywords: +buildbot nosy: +flox status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9147 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9147] dis.show_code() variant that accepts source strings (and returns rather than prints)
Nick Coghlan ncogh...@gmail.com added the comment: I changed the test to a regex match that ignores the specific ID value of the nested function in r84137. That should make the buildbots happier. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9147 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9147] dis.show_code() variant that accepts source strings (and returns rather than prints)
Nick Coghlan ncogh...@gmail.com added the comment: Switching to a regex match made the backslashes in windows paths a problem. r84139 changes the test to just ignore all the variable info in the code_info results so we'll see how that goes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9147 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9147] dis.show_code() variant that accepts source strings (and returns rather than prints)
Nick Coghlan ncogh...@gmail.com added the comment: The windows buildbot still doesn't appear to be particularly happy, but this issue also doesn't appear to be the culprit anymore. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9147 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9147] dis.show_code() variant that accepts source strings (and returns rather than prints)
New submission from Nick Coghlan ncogh...@gmail.com: Add a new API in the dis module that: 1. Works like show_code() but returns a string rather than printing to stdout 2. Accepts source strings directly, similar to the dis.dis() changes for 3.2 Tentative name: get_code_info() Inspired by Yanov Aknin's ssc() utility and the issue 6507 updates to dis.dis() -- assignee: ncoghlan components: Library (Lib) messages: 109161 nosy: ncoghlan priority: normal severity: normal status: open title: dis.show_code() variant that accepts source strings (and returns rather than prints) type: feature request versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9147 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9147] dis.show_code() variant that accepts source strings (and returns rather than prints)
Mark Dickinson dicki...@gmail.com added the comment: Yes, please! -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9147 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9147] dis.show_code() variant that accepts source strings (and returns rather than prints)
Nick Coghlan ncogh...@gmail.com added the comment: Small correction to my first message: that would be Yaniv Aknin (not Yanov) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9147 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9147] dis.show_code() variant that accepts source strings (and returns rather than prints)
Changes by Daniel Urban urban.dani...@gmail.com: -- nosy: +durban ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9147 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com