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
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.
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>)
>
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
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