]> granicus.if.org Git - python/commit
Close #19378: address flaws in the new dis module APIs
authorNick Coghlan <ncoghlan@gmail.com>
Wed, 6 Nov 2013 12:08:36 +0000 (22:08 +1000)
committerNick Coghlan <ncoghlan@gmail.com>
Wed, 6 Nov 2013 12:08:36 +0000 (22:08 +1000)
commit90b8e7d2bc20a6b63042ca9ba5024ea8bb45d168
tree6c2a688294bf44a91c1401f1e17e708af40ea6c7
parente0881f464cea34b263efe45afb92b5919a639468
Close #19378: address flaws in the new dis module APIs

- confusing line_offset parameter -> first_line parameter
- systematically test and fix new file parameter
- remove redundant Bytecode.show_info() API
- rename Bytecode.display_code() to Bytecode.dis() and have it
  return the multi-line string rather than printing it directly
- eliminated some not-so-helpful helpers from the bytecode_helper
  test support module

Also fixed a longstanding defect (worked around in the test suite)
where lines emitted by the dis module could include trailing white
space. That no longer happens, allowing the formatting tests to be
simplified to use plain string comparisons.
Doc/library/dis.rst
Lib/dis.py
Lib/test/bytecode_helper.py
Lib/test/test_dis.py
Misc/NEWS