Skip to content

Add option to show details from code_info #5

Open
@jtpio

Description

@jtpio

It would be interesting to have an option in the "Advanced Settings Editor" to show the details that come from dis.code_info, and display it on the top of the panel (before the bytecode) or in a different JupyterLab widget.

For example:

import dis

code_to_eval = """
a = 2
b = a + 1
"""

code = compile(code_to_eval, '<string>', 'exec')
code_info = dis.code_info(code)
print(code_info)

would output:

Name:              <module>
Filename:          <string>
Argument count:    0
Kw-only arguments: 0
Number of locals:  0
Stack size:        2
Flags:             NOFREE
Constants:
   0: 2
   1: 1
   2: None
Names:
   0: a
   1: b

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions