Skip to content

Commit a53111d

Browse files
committed
up
1 parent 007eccf commit a53111d

3 files changed

Lines changed: 234 additions & 177 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from dis import dis
2+
3+
a = '''
4+
class MyClass:
5+
x: int = testadd(2, 5)
6+
'''
7+
8+
dis(compile(a, '<string>', 'exec'))
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include "pocketpy.h"
2+
#include <stdio.h>
3+
4+
#define INPUT ""
5+
6+
static bool testadd(int argc, py_Ref argv) {
7+
PY_CHECK_ARGC(2);
8+
return py_binaryadd(&argv[0], &argv[1]);
9+
}
10+
11+
int main() {
12+
py_initialize();
13+
14+
py_compiletime_bind("testadd(__a, __b)", testadd);
15+
16+
if (!py_exec(INPUT, "main.py", EXEC_MODE, NULL)) {
17+
py_printexc();
18+
}
19+
20+
py_finalize();
21+
return 0;
22+
}

0 commit comments

Comments
 (0)