[issue19378] Clean up Python 3.4 API additions in the dis module

2013-11-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ce8dd299cdc4 by Nick Coghlan in branch 'default':
Close #19378: address flaws in the new dis module APIs
http://hg.python.org/cpython/rev/ce8dd299cdc4

--
nosy: +python-dev
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19378
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19378] Clean up Python 3.4 API additions in the dis module

2013-11-04 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
assignee:  - ncoghlan

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19378
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19378] Clean up Python 3.4 API additions in the dis module

2013-11-03 Thread Nick Coghlan

Nick Coghlan added the comment:

While working on this, I noticed a number of other issues with the dis API 
additions for Python 3.4 from issue 11816. Specifically:

- the file output redirection API didn't work in some cases that resulted in 
calls to other disassembly functions
- Bytecode.show_info() replicates a bad module level API that shouldn't be 
perpetuated
- Bytecode.display_code() is better converted to a dis() method that returns a 
string rather than writing directly to an output stream

--
keywords: +patch
nosy: +larry, rfk, rhettinger
priority: normal - release blocker
title: Rename line_offset parameter in dis.get_instructions to first_line 
- Clean up Python 3.4 API additions in the dis module
versions: +Python 3.4
Added file: http://bugs.python.org/file32479/issue19378_dis_module_fixes.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19378
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19378] Clean up Python 3.4 API additions in the dis module

2013-11-03 Thread Larry Hastings

Larry Hastings added the comment:

Would this be a good time for me to ask about publishing the stack effect info? 
 I had to write my own parallel implementation of it for my assembler, so I 
found it irritating that Python doesn't provide it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19378
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19378] Clean up Python 3.4 API additions in the dis module

2013-11-03 Thread Nick Coghlan

Nick Coghlan added the comment:

I think it's a good idea in principle, but unrelated to this patch :)

This one started as reworking line_offset as a more intuitive first_line 
parameter, and then testing and documenting that change proceeded to reveal a 
number of other issues with the 3.4 API additions :P

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19378
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19378] Clean up Python 3.4 API additions in the dis module

2013-11-03 Thread Nick Coghlan

Nick Coghlan added the comment:

There was another change implemented as part of this: trailing whitespace is 
now stripped from the lines emitted by the disassembler, which made it possible 
to simplify the tests a bit (since they no longer have to strip that whitespace 
themselves, they can just do normal string comparisons)

I rediscovered this existing issue, since the new more comprehensive tests for 
correct handling of the file parameter didn't have the extra operations to 
strip the trailing whitespace from each line. Rather than adding it, I just 
fixed the dissassembler to avoid emitting it in the first place (that was a lot 
easier now that Instruction._disassemble was the sole place responsible for 
emitting each line)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19378
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com