l0n0lc 0.10.0__tar.gz → 0.10.2__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.10.0
3
+ Version: 0.10.2
4
4
  Summary: 一个将python函数翻译为c++函数并运行的jit编译器
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Requires-Python: >=3.10
@@ -3,10 +3,6 @@ from .通用 import 生成变量Id, toCString, 通用信息
3
3
  import ctypes
4
4
 
5
5
 
6
- def cpp获取变量类型(v):
7
- return f'decltype({v})'
8
-
9
-
10
6
  class cpp类型:
11
7
  INT8_T = 'int8_t'
12
8
  INT16_T = 'int16_t'
@@ -54,11 +50,11 @@ def py类型转ctypes类型(类型):
54
50
  ret = 执行额外函数(额外py转ctypes函数, 类型)
55
51
  if ret is not None:
56
52
  return ret
57
-
53
+
58
54
  ret = 通用信息.类型映射表.get(类型)
59
55
  if ret is not None:
60
56
  return ret.对应的ctypes类型
61
-
57
+
62
58
  return py2ctypes映射表.get(类型)
63
59
 
64
60
 
@@ -112,11 +108,6 @@ def py类型转c类型(类型):
112
108
  return cpp类型.ANY
113
109
 
114
110
 
115
- def cpp类型检查(类型, 支持提示: str):
116
- if 类型 not in [int, float, str, bool]:
117
- raise Exception(f'{支持提示} 仅支持 [int, float, str, bool]')
118
-
119
-
120
111
  class list初始化列表:
121
112
  def __init__(
122
113
  self,
@@ -138,7 +129,6 @@ def 从list构建初始化列表(value: List):
138
129
  初始化列表 = []
139
130
  for v in value:
140
131
  dtype = type(v)
141
- cpp类型检查(dtype, 'List')
142
132
  数据类型列表.append(dtype)
143
133
  初始化列表.append(toCString(v))
144
134
  # 构建初始化列表
@@ -175,9 +165,7 @@ def 从dict构建初始化列表(value: dict):
175
165
  value类型列表 = []
176
166
  for k, v in value.items():
177
167
  key类型 = type(k)
178
- cpp类型检查(key类型, 'Map')
179
168
  value类型 = type(v)
180
- cpp类型检查(value类型, 'Map')
181
169
  key类型列表.append(key类型)
182
170
  value类型列表.append(value类型)
183
171
  code.append(f'{{ {toCString(k)}, {v} }}')
@@ -207,8 +195,8 @@ class c变量:
207
195
  return self.c名字
208
196
 
209
197
  @property
210
- def c类型(self):
211
- return cpp获取变量类型(self)
198
+ def decltype(self):
199
+ return f'decltype({self})'
212
200
 
213
201
  def 初始化(self, 初始值, 强转类型: str | None = None):
214
202
  if 强转类型:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: l0n0lc
3
- Version: 0.10.0
3
+ Version: 0.10.2
4
4
  Summary: 一个将python函数翻译为c++函数并运行的jit编译器
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Requires-Python: >=3.10
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "l0n0lc"
3
- version = "0.10.0"
3
+ version = "0.10.2"
4
4
  description = "一个将python函数翻译为c++函数并运行的jit编译器"
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
File without changes