Re: [Python-Dev] Disassembly of generated comprehensions

2015-01-25 Thread Nick Coghlan
On 26 Jan 2015 07:58, "Greg Ewing" wrote: > > Petr Viktorin wrote: >> >> On Sun, Jan 25, 2015 at 12:55 PM, Neil Girdhar wrote: >> >>> How do I disassemble a generated comprehension? >>> >> Put it in a function, then get it from the function's code's constants. > > > It would be handy if dis had a

Re: [Python-Dev] Disassembly of generated comprehensions

2015-01-25 Thread Greg Ewing
Petr Viktorin wrote: On Sun, Jan 25, 2015 at 12:55 PM, Neil Girdhar wrote: How do I disassemble a generated comprehension? Put it in a function, then get it from the function's code's constants. It would be handy if dis had an option to disassemble nested functions like this automatically.

Re: [Python-Dev] Disassembly of generated comprehensions

2015-01-25 Thread Petr Viktorin
On Sun, Jan 25, 2015 at 12:55 PM, Neil Girdhar wrote: > How do I disassemble a generated comprehension? > > For example, I am trying to debug the following: > dis.dis('{**{} for x in [{1:2}]}') > 1 0 LOAD_CONST 0 ( at > 0x10160b7c0, file "", line 1>) >

Re: [Python-Dev] Disassembly of generated comprehensions

2015-01-25 Thread Neil Girdhar
Perfect, thanks! On Sun, Jan 25, 2015 at 7:08 AM, Petr Viktorin wrote: > On Sun, Jan 25, 2015 at 12:55 PM, Neil Girdhar > wrote: > > How do I disassemble a generated comprehension? > > > > For example, I am trying to debug the following: > > > dis.dis('{**{} for x in [{1:2}]}') > > 1

[Python-Dev] Disassembly of generated comprehensions

2015-01-25 Thread Neil Girdhar
How do I disassemble a generated comprehension? For example, I am trying to debug the following: >>> dis.dis('{**{} for x in [{1:2}]}') 1 0 LOAD_CONST 0 ( at 0x10160b7c0, file "", line 1>) 3 LOAD_CONST 1 ('') 6 MAKE_FUNCTION