Skip to content

Commit f4d9c0f

Browse files
committed
fix: access ast and bytecode
1 parent 5d65e6f commit f4d9c0f

7 files changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import dis
2+
from hello import hello
3+
4+
print(dis.dis(hello))

2_standard_library/32_python_language_services/10_dis/__init__.py

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def hello(name):
2+
print(f"Hello {name}")
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import ast
2+
import inspect
3+
import pprint
4+
from hello import hello
5+
6+
7+
pprint.pprint(ast.dump(ast.parse(inspect.getsource(hello))))

2_standard_library/32_python_language_services/1_ast/__init__.py

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def hello(name):
2+
print(f"Hello {name}")

2_standard_library/32_python_language_services/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)