l0n0lc 0.7.1__tar.gz → 0.7.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: l0n0lc
3
- Version: 0.7.1
3
+ Version: 0.7.3
4
4
  Summary: 用python写c
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Requires-Python: >=3.10
@@ -29,6 +29,9 @@ def cpp_cout(*args):
29
29
  code += '<< std::endl;'
30
30
  return code
31
31
 
32
+ @lc.直接调用函数
33
+ def test_直接调用():
34
+ return 123
32
35
 
33
36
  @lc.jit(每次运行都重新编译=True)
34
37
  def test_add(a: int, b: int) -> int:
@@ -50,10 +53,10 @@ def test_add(a: int, b: int) -> int:
50
53
  for i in range(3):
51
54
  print(i, aa[i])
52
55
  print('Hello World', a, b)
53
- return a + b + 1
54
-
56
+ return a + b + 1 + test_直接调用()
55
57
 
56
58
  print('结果:', test_add(1, 3))
59
+
57
60
  ```
58
61
  ## 执行hello_world.py
59
62
  ```bash
@@ -67,20 +70,20 @@ b 2
67
70
  1 3
68
71
  2 2
69
72
  Hello World 13 3
70
- 结果: 17
73
+ 结果: 140
71
74
  ```
72
75
  ## 查看生成的c++代码文件
73
76
  ```bash
74
- $ ls -al l0n0lcoutput
75
- total 44
76
- drwxr-xr-x 2 root root 4096 Sep 11 01:38 .
77
- drwxrwxrwx 12 1000 1000 4096 Sep 10 02:36 ..
78
- -rw-r--r-- 1 root root 599 Sep 11 01:38 test_add_@402bbf73254216d8.cpp
79
- -rw-r--r-- 1 root root 150 Sep 11 01:38 test_add_@402bbf73254216d8.h
80
- -rwxr-xr-x 1 root root 25264 Sep 11 01:38 test_add_@402bbf73254216d8.so
77
+ $ ls -al l0n0lcoutput/
78
+ total 48
79
+ drwxr-xr-x 2 root root 4096 Sep 11 02:32 .
80
+ drwxrwxrwx 11 1000 1000 4096 Sep 11 02:32 ..
81
+ -rw-r--r-- 1 root root 794 Sep 11 02:32 test_add_@0bfbc28de3631ddd.cpp
82
+ -rw-r--r-- 1 root root 150 Sep 11 02:32 test_add_@0bfbc28de3631ddd.h
83
+ -rwxr-xr-x 1 root root 29496 Sep 11 02:32 test_add_@0bfbc28de3631ddd.so
81
84
  ```
82
85
 
83
- ## test_add_@402bbf73254216d8.h
86
+ ## test_add_@0bfbc28de3631ddd.h
84
87
 
85
88
  ```c++
86
89
  #include <cmath>
@@ -91,7 +94,7 @@ drwxrwxrwx 12 1000 1000 4096 Sep 10 02:36 ..
91
94
  extern "C" int64_t test_add (int64_t a, int64_t b);
92
95
  ```
93
96
 
94
- ## test_add_@402bbf73254216d8.cpp
97
+ ## test_add_@0bfbc28de3631ddd.cpp
95
98
  ```c++
96
99
  #include "test_add_@141921ba1aaa0352.h"
97
100
  extern "C" int64_t test_add (int64_t a, int64_t b)
@@ -19,6 +19,9 @@ def cpp_cout(*args):
19
19
  code += '<< std::endl;'
20
20
  return code
21
21
 
22
+ @lc.直接调用函数
23
+ def test_直接调用():
24
+ return 123
22
25
 
23
26
  @lc.jit(每次运行都重新编译=True)
24
27
  def test_add(a: int, b: int) -> int:
@@ -40,10 +43,10 @@ def test_add(a: int, b: int) -> int:
40
43
  for i in range(3):
41
44
  print(i, aa[i])
42
45
  print('Hello World', a, b)
43
- return a + b + 1
44
-
46
+ return a + b + 1 + test_直接调用()
45
47
 
46
48
  print('结果:', test_add(1, 3))
49
+
47
50
  ```
48
51
  ## 执行hello_world.py
49
52
  ```bash
@@ -57,20 +60,20 @@ b 2
57
60
  1 3
58
61
  2 2
59
62
  Hello World 13 3
60
- 结果: 17
63
+ 结果: 140
61
64
  ```
62
65
  ## 查看生成的c++代码文件
63
66
  ```bash
64
- $ ls -al l0n0lcoutput
65
- total 44
66
- drwxr-xr-x 2 root root 4096 Sep 11 01:38 .
67
- drwxrwxrwx 12 1000 1000 4096 Sep 10 02:36 ..
68
- -rw-r--r-- 1 root root 599 Sep 11 01:38 test_add_@402bbf73254216d8.cpp
69
- -rw-r--r-- 1 root root 150 Sep 11 01:38 test_add_@402bbf73254216d8.h
70
- -rwxr-xr-x 1 root root 25264 Sep 11 01:38 test_add_@402bbf73254216d8.so
67
+ $ ls -al l0n0lcoutput/
68
+ total 48
69
+ drwxr-xr-x 2 root root 4096 Sep 11 02:32 .
70
+ drwxrwxrwx 11 1000 1000 4096 Sep 11 02:32 ..
71
+ -rw-r--r-- 1 root root 794 Sep 11 02:32 test_add_@0bfbc28de3631ddd.cpp
72
+ -rw-r--r-- 1 root root 150 Sep 11 02:32 test_add_@0bfbc28de3631ddd.h
73
+ -rwxr-xr-x 1 root root 29496 Sep 11 02:32 test_add_@0bfbc28de3631ddd.so
71
74
  ```
72
75
 
73
- ## test_add_@402bbf73254216d8.h
76
+ ## test_add_@0bfbc28de3631ddd.h
74
77
 
75
78
  ```c++
76
79
  #include <cmath>
@@ -81,7 +84,7 @@ drwxrwxrwx 12 1000 1000 4096 Sep 10 02:36 ..
81
84
  extern "C" int64_t test_add (int64_t a, int64_t b);
82
85
  ```
83
86
 
84
- ## test_add_@402bbf73254216d8.cpp
87
+ ## test_add_@0bfbc28de3631ddd.cpp
85
88
  ```c++
86
89
  #include "test_add_@141921ba1aaa0352.h"
87
90
  extern "C" int64_t test_add (int64_t a, int64_t b)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: l0n0lc
3
- Version: 0.7.1
3
+ Version: 0.7.3
4
4
  Summary: 用python写c
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Requires-Python: >=3.10
@@ -29,6 +29,9 @@ def cpp_cout(*args):
29
29
  code += '<< std::endl;'
30
30
  return code
31
31
 
32
+ @lc.直接调用函数
33
+ def test_直接调用():
34
+ return 123
32
35
 
33
36
  @lc.jit(每次运行都重新编译=True)
34
37
  def test_add(a: int, b: int) -> int:
@@ -50,10 +53,10 @@ def test_add(a: int, b: int) -> int:
50
53
  for i in range(3):
51
54
  print(i, aa[i])
52
55
  print('Hello World', a, b)
53
- return a + b + 1
54
-
56
+ return a + b + 1 + test_直接调用()
55
57
 
56
58
  print('结果:', test_add(1, 3))
59
+
57
60
  ```
58
61
  ## 执行hello_world.py
59
62
  ```bash
@@ -67,20 +70,20 @@ b 2
67
70
  1 3
68
71
  2 2
69
72
  Hello World 13 3
70
- 结果: 17
73
+ 结果: 140
71
74
  ```
72
75
  ## 查看生成的c++代码文件
73
76
  ```bash
74
- $ ls -al l0n0lcoutput
75
- total 44
76
- drwxr-xr-x 2 root root 4096 Sep 11 01:38 .
77
- drwxrwxrwx 12 1000 1000 4096 Sep 10 02:36 ..
78
- -rw-r--r-- 1 root root 599 Sep 11 01:38 test_add_@402bbf73254216d8.cpp
79
- -rw-r--r-- 1 root root 150 Sep 11 01:38 test_add_@402bbf73254216d8.h
80
- -rwxr-xr-x 1 root root 25264 Sep 11 01:38 test_add_@402bbf73254216d8.so
77
+ $ ls -al l0n0lcoutput/
78
+ total 48
79
+ drwxr-xr-x 2 root root 4096 Sep 11 02:32 .
80
+ drwxrwxrwx 11 1000 1000 4096 Sep 11 02:32 ..
81
+ -rw-r--r-- 1 root root 794 Sep 11 02:32 test_add_@0bfbc28de3631ddd.cpp
82
+ -rw-r--r-- 1 root root 150 Sep 11 02:32 test_add_@0bfbc28de3631ddd.h
83
+ -rwxr-xr-x 1 root root 29496 Sep 11 02:32 test_add_@0bfbc28de3631ddd.so
81
84
  ```
82
85
 
83
- ## test_add_@402bbf73254216d8.h
86
+ ## test_add_@0bfbc28de3631ddd.h
84
87
 
85
88
  ```c++
86
89
  #include <cmath>
@@ -91,7 +94,7 @@ drwxrwxrwx 12 1000 1000 4096 Sep 10 02:36 ..
91
94
  extern "C" int64_t test_add (int64_t a, int64_t b);
92
95
  ```
93
96
 
94
- ## test_add_@402bbf73254216d8.cpp
97
+ ## test_add_@0bfbc28de3631ddd.cpp
95
98
  ```c++
96
99
  #include "test_add_@141921ba1aaa0352.h"
97
100
  extern "C" int64_t test_add (int64_t a, int64_t b)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "l0n0lc"
3
- version = "0.7.1"
3
+ version = "0.7.3"
4
4
  description = "用python写c"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes