soia-client 1.0.5__py3-none-any.whl → 1.0.6__py3-none-any.whl

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.

Potentially problematic release.


This version of soia-client might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: soia-client
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Author-email: Tyler Fibonacci <gepheum@gmail.com>
5
5
  License: MIT License
6
6
 
@@ -15,10 +15,10 @@ soialib/impl/function_maker.py,sha256=PYqHqnZf8nELfEnRcoyyUbPAHyr99ROHhmHGj9ldB6
15
15
  soialib/impl/optionals.py,sha256=QUcxx0i7oAQl7IcnxKyNW11xi7fbs2hmuSP1pfrTSTY,2120
16
16
  soialib/impl/primitives.py,sha256=X_ywRmVZI_Q5tatb1Qil6Xvdyh1J4ElfI-LOCn671Zk,5975
17
17
  soialib/impl/repr.py,sha256=z-_jGNKuY__DfwQKW40xzZFf_eG6wGMJvuY_2hJrETA,1441
18
- soialib/impl/structs.py,sha256=pXPn6SeyZH-FwQXbvUG_uoc5DZ8oZgDQ5v_jx8Uf5aY,23576
18
+ soialib/impl/structs.py,sha256=jF-R89-k1lQKWjClhOPVIkJTKQcFyuF92DiVCWCB5dI,24018
19
19
  soialib/impl/type_adapter.py,sha256=IP3jF3wPgwKhWd7LKMmbbv1qUTv1HBAyMdpVrIg0_S0,2063
20
- soia_client-1.0.5.dist-info/LICENSE,sha256=SaAftKkX6hfSOiPdENQPS70tifH3PDHgazq8eK2Pwfw,1064
21
- soia_client-1.0.5.dist-info/METADATA,sha256=JWD4wSPRLd1uz_nCM37-Y2DAKnf_5gO-QcHye3hYmMw,1645
22
- soia_client-1.0.5.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
23
- soia_client-1.0.5.dist-info/top_level.txt,sha256=2vPmAo5G0SrCxYrNdJKJJVdpalYppgjO2mmz2PtsFUI,8
24
- soia_client-1.0.5.dist-info/RECORD,,
20
+ soia_client-1.0.6.dist-info/LICENSE,sha256=SaAftKkX6hfSOiPdENQPS70tifH3PDHgazq8eK2Pwfw,1064
21
+ soia_client-1.0.6.dist-info/METADATA,sha256=TkXFJzFY6v1MNEAP_pMEs93vxJuTneiP2ytY7D2W4P4,1645
22
+ soia_client-1.0.6.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
23
+ soia_client-1.0.6.dist-info/top_level.txt,sha256=2vPmAo5G0SrCxYrNdJKJJVdpalYppgjO2mmz2PtsFUI,8
24
+ soia_client-1.0.6.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.2.0)
2
+ Generator: setuptools (75.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
soialib/impl/structs.py CHANGED
@@ -146,7 +146,7 @@ class StructAdapter(TypeAdapter):
146
146
  )
147
147
 
148
148
  # Initialize DEFAULT.
149
- self.gen_class.DEFAULT.__init__()
149
+ _init_default(self.gen_class.DEFAULT, fields)
150
150
 
151
151
  # Define mutable getters
152
152
  for field in fields:
@@ -674,6 +674,18 @@ def _adjust_array_len_expr(var: str, removed_numbers: tuple[int, ...]) -> str:
674
674
  return ret
675
675
 
676
676
 
677
+ def _init_default(default: Any, fields: Sequence[_Field]) -> None:
678
+ for field in fields:
679
+ attribute = field.field.attribute
680
+ get_field_default = make_function(
681
+ name="get_default",
682
+ params=(),
683
+ body=(Line.join("return ", field.type.default_expr()),),
684
+ )
685
+ object.__setattr__(default, attribute, get_field_default())
686
+ object.__setattr__(default, "_array_len", 0)
687
+
688
+
677
689
  def _make_mutable_getter(field: _Field) -> Callable[[Any], Any]:
678
690
  # Two cases: the field either has struct type or array type.
679
691
  attribute = field.field.attribute