obstruct 0.2.12__tar.gz → 0.2.13__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.
Files changed (29) hide show
  1. {obstruct-0.2.12 → obstruct-0.2.13}/.idea/workspace.xml +21 -6
  2. {obstruct-0.2.12 → obstruct-0.2.13}/PKG-INFO +7 -5
  3. {obstruct-0.2.12 → obstruct-0.2.13}/README.md +5 -3
  4. {obstruct-0.2.12 → obstruct-0.2.13}/pyproject.toml +9 -1
  5. obstruct-0.2.13/src/obstruct/__version__.py +1 -0
  6. {obstruct-0.2.12 → obstruct-0.2.13}/src/obstruct/struct_type.py +1 -0
  7. obstruct-0.2.12/src/obstruct/__version__.py +0 -1
  8. {obstruct-0.2.12 → obstruct-0.2.13}/.idea/.gitignore +0 -0
  9. {obstruct-0.2.12 → obstruct-0.2.13}/.idea/inspectionProfiles/Project_Default.xml +0 -0
  10. {obstruct-0.2.12 → obstruct-0.2.13}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
  11. {obstruct-0.2.12 → obstruct-0.2.13}/.idea/misc.xml +0 -0
  12. {obstruct-0.2.12 → obstruct-0.2.13}/.idea/modules.xml +0 -0
  13. {obstruct-0.2.12 → obstruct-0.2.13}/.idea/obstruct.iml +0 -0
  14. {obstruct-0.2.12 → obstruct-0.2.13}/.idea/vcs.xml +0 -0
  15. {obstruct-0.2.12 → obstruct-0.2.13}/src/obstruct/__init__.py +0 -0
  16. {obstruct-0.2.12 → obstruct-0.2.13}/src/obstruct/aot/__init__.py +0 -0
  17. {obstruct-0.2.12 → obstruct-0.2.13}/src/obstruct/aot/aot.py +0 -0
  18. {obstruct-0.2.12 → obstruct-0.2.13}/src/obstruct/aot/base.py +0 -0
  19. {obstruct-0.2.12 → obstruct-0.2.13}/src/obstruct/aot/pack.py +0 -0
  20. {obstruct-0.2.12 → obstruct-0.2.13}/src/obstruct/aot/unpack.py +0 -0
  21. {obstruct-0.2.12 → obstruct-0.2.13}/src/obstruct/metadata_marks.py +0 -0
  22. {obstruct-0.2.12 → obstruct-0.2.13}/src/obstruct/methods.py +0 -0
  23. {obstruct-0.2.12 → obstruct-0.2.13}/src/obstruct/types/__init__.py +0 -0
  24. {obstruct-0.2.12 → obstruct-0.2.13}/src/obstruct/types/base.py +0 -0
  25. {obstruct-0.2.12 → obstruct-0.2.13}/src/obstruct/types/types.py +0 -0
  26. {obstruct-0.2.12 → obstruct-0.2.13}/src/obstruct/types/types.pyi +0 -0
  27. {obstruct-0.2.12 → obstruct-0.2.13}/test/test.py +0 -0
  28. {obstruct-0.2.12 → obstruct-0.2.13}/test/test_speed.py +0 -0
  29. {obstruct-0.2.12 → obstruct-0.2.13}/uv.lock +0 -0
@@ -4,10 +4,7 @@
4
4
  <option name="autoReloadType" value="SELECTIVE" />
5
5
  </component>
6
6
  <component name="ChangeListManager">
7
- <list default="true" id="b482b6b4-48ce-4be1-bf3c-a72ec254fa35" name="更改" comment="feat: 更新版本号(跳过一次版本号更改),添加 NOT_A_FIELD 标记控制一个字段是否该被当作二进制字段解析">
8
- <change beforePath="$PROJECT_DIR$/src/obstruct/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/obstruct/__init__.py" afterDir="false" />
9
- <change beforePath="$PROJECT_DIR$/src/obstruct/__version__.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/obstruct/__version__.py" afterDir="false" />
10
- </list>
7
+ <list default="true" id="b482b6b4-48ce-4be1-bf3c-a72ec254fa35" name="更改" comment="chore: 更新项目信息和 README 文档" />
11
8
  <option name="SHOW_DIALOG" value="false" />
12
9
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
13
10
  <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -239,7 +236,23 @@
239
236
  <option name="project" value="LOCAL" />
240
237
  <updated>1786968425494</updated>
241
238
  </task>
242
- <option name="localTasksCounter" value="14" />
239
+ <task id="LOCAL-00014" summary="feat: 更新版本号,添加一些更加清晰明确的类型别名">
240
+ <option name="closed" value="true" />
241
+ <created>1786969304874</created>
242
+ <option name="number" value="00014" />
243
+ <option name="presentableId" value="LOCAL-00014" />
244
+ <option name="project" value="LOCAL" />
245
+ <updated>1786969304874</updated>
246
+ </task>
247
+ <task id="LOCAL-00015" summary="chore: 更新项目信息和 README 文档">
248
+ <option name="closed" value="true" />
249
+ <created>1786969506672</created>
250
+ <option name="number" value="00015" />
251
+ <option name="presentableId" value="LOCAL-00015" />
252
+ <option name="project" value="LOCAL" />
253
+ <updated>1786969506672</updated>
254
+ </task>
255
+ <option name="localTasksCounter" value="16" />
243
256
  <servers />
244
257
  </component>
245
258
  <component name="TypeScriptGeneratedFilesManager">
@@ -270,6 +283,8 @@
270
283
  <MESSAGE value="chore: 移除 test_speed.py 中的调试逻辑" />
271
284
  <MESSAGE value="fix: 修复 slots 的生成逻辑" />
272
285
  <MESSAGE value="feat: 更新版本号(跳过一次版本号更改),添加 NOT_A_FIELD 标记控制一个字段是否该被当作二进制字段解析" />
273
- <option name="LAST_COMMIT_MESSAGE" value="feat: 更新版本号(跳过一次版本号更改),添加 NOT_A_FIELD 标记控制一个字段是否该被当作二进制字段解析" />
286
+ <MESSAGE value="feat: 更新版本号,添加一些更加清晰明确的类型别名" />
287
+ <MESSAGE value="chore: 更新项目信息和 README 文档" />
288
+ <option name="LAST_COMMIT_MESSAGE" value="chore: 更新项目信息和 README 文档" />
274
289
  </component>
275
290
  </project>
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: obstruct
3
- Version: 0.2.12
3
+ Version: 0.2.13
4
4
  Author-email: LittleNightSong <LittleNightSongYO@outlook.com>
5
5
  Classifier: Development Status :: 3 - Alpha
6
6
  Classifier: Programming Language :: Python
7
- Classifier: Programming Language :: Python :: 3.11
8
7
  Classifier: Programming Language :: Python :: 3.12
9
8
  Classifier: Programming Language :: Python :: 3.13
9
+ Classifier: Programming Language :: Python :: 3.14
10
10
  Classifier: Programming Language :: Python :: Implementation :: CPython
11
11
  Classifier: Programming Language :: Python :: Implementation :: PyPy
12
12
  Requires-Python: >=3.12
@@ -16,7 +16,7 @@ _来自已弃坑的 `Hydrogenlib`,重拾起当初的决心_
16
16
 
17
17
 
18
18
  > [!TIP]
19
- > 这个项目来自 [`HydrogenLib`](https://github.com/LittleNightSong/HydrogenLib)的 `Objective-Struct` 模块,脱离大项目的版本
19
+ > 这个项目来自 [`HydrogenLib`](https://github.com/LittleNightSong/HydrogenLib)的 `Objective-Struct` 模块,是一个脱离大项目的版本
20
20
  >
21
21
  > 同时,`HydrogenLib`中的 `Objective-Struct` 不再会更新
22
22
 
@@ -36,7 +36,7 @@ _一个简单、纯粹、极速的二进制解析库_
36
36
  - 完整的操作支持(打包、解包、流式处理)
37
37
 
38
38
  > [!WARNING]
39
- >使用 `array` 类型时,建议不要传入 list 类型或其它 Python 序列,
39
+ > 使用 `array` 类型时,建议不要传入 list 类型或其它 Python 序列,
40
40
  > 可能会带来极大的性能影响
41
41
 
42
42
  ## 基准测试
@@ -67,7 +67,6 @@ import obstruct as obs
67
67
  from dataclasses import dataclass
68
68
 
69
69
 
70
- @obs.struct()
71
70
  @dataclass()
72
71
  class MyStruct(obs.Struct):
73
72
  a: int
@@ -89,6 +88,9 @@ if __name__ == '__main__':
89
88
 
90
89
  ```
91
90
 
91
+ > [!WARNING]
92
+ > 不要在 dataclass 装饰器中使用 `slots=True`,`Struct` 元类已为类型添加了 `__slots__`
93
+
92
94
  在上述示例中,你可能发现 `data != restored`,这是浮点数的精度限制导致的。 因此,我们不建议使用浮点数类型,浮点数在二进制传输中也不常见。
93
95
 
94
96
  ## 计划
@@ -2,7 +2,7 @@ _来自已弃坑的 `Hydrogenlib`,重拾起当初的决心_
2
2
 
3
3
 
4
4
  > [!TIP]
5
- > 这个项目来自 [`HydrogenLib`](https://github.com/LittleNightSong/HydrogenLib)的 `Objective-Struct` 模块,脱离大项目的版本
5
+ > 这个项目来自 [`HydrogenLib`](https://github.com/LittleNightSong/HydrogenLib)的 `Objective-Struct` 模块,是一个脱离大项目的版本
6
6
  >
7
7
  > 同时,`HydrogenLib`中的 `Objective-Struct` 不再会更新
8
8
 
@@ -22,7 +22,7 @@ _一个简单、纯粹、极速的二进制解析库_
22
22
  - 完整的操作支持(打包、解包、流式处理)
23
23
 
24
24
  > [!WARNING]
25
- >使用 `array` 类型时,建议不要传入 list 类型或其它 Python 序列,
25
+ > 使用 `array` 类型时,建议不要传入 list 类型或其它 Python 序列,
26
26
  > 可能会带来极大的性能影响
27
27
 
28
28
  ## 基准测试
@@ -53,7 +53,6 @@ import obstruct as obs
53
53
  from dataclasses import dataclass
54
54
 
55
55
 
56
- @obs.struct()
57
56
  @dataclass()
58
57
  class MyStruct(obs.Struct):
59
58
  a: int
@@ -75,6 +74,9 @@ if __name__ == '__main__':
75
74
 
76
75
  ```
77
76
 
77
+ > [!WARNING]
78
+ > 不要在 dataclass 装饰器中使用 `slots=True`,`Struct` 元类已为类型添加了 `__slots__`
79
+
78
80
  在上述示例中,你可能发现 `data != restored`,这是浮点数的精度限制导致的。 因此,我们不建议使用浮点数类型,浮点数在二进制传输中也不常见。
79
81
 
80
82
  ## 计划
@@ -9,7 +9,15 @@ description = ''
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
11
11
  keywords = []
12
- classifiers = ["Development Status :: 3 - Alpha", "Programming Language :: Python", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy"]
12
+ classifiers = [
13
+ "Development Status :: 3 - Alpha",
14
+ "Programming Language :: Python",
15
+ "Programming Language :: Python :: 3.12",
16
+ "Programming Language :: Python :: 3.13",
17
+ "Programming Language :: Python :: 3.14",
18
+ "Programming Language :: Python :: Implementation :: CPython",
19
+ "Programming Language :: Python :: Implementation :: PyPy"
20
+ ]
13
21
  dependencies = []
14
22
 
15
23
  [[project.authors]]
@@ -0,0 +1 @@
1
+ version = "0.2.13"
@@ -46,6 +46,7 @@ class StructMeta(type):
46
46
  )
47
47
 
48
48
  slots |= {k for k in annotations.keys()}
49
+ slots -= cls.__struct_methods__
49
50
 
50
51
  attrs['__slots__'] = slots
51
52
  attrs['__cendian__'] = endian
@@ -1 +0,0 @@
1
- version = "0.2.12"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes