ducktools-classbuilder 0.6.2__py3-none-any.whl → 0.6.3__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 ducktools-classbuilder might be problematic. Click here for more details.

@@ -34,7 +34,7 @@ import sys
34
34
 
35
35
  from .annotations import get_ns_annotations, is_classvar
36
36
 
37
- __version__ = "v0.6.2"
37
+ __version__ = "v0.6.3"
38
38
 
39
39
  # Change this name if you make heavy modifications
40
40
  INTERNALS_DICT = "__classbuilder_internals__"
@@ -294,6 +294,7 @@ def attribute(
294
294
  kw_only=False,
295
295
  serialize=True,
296
296
  exclude_field=False,
297
+ private=False,
297
298
  doc=None,
298
299
  type=NOTHING,
299
300
  ):
@@ -310,6 +311,7 @@ def attribute(
310
311
  :param kw_only: Make this argument keyword only in init
311
312
  :param serialize: Include this attribute in methods that serialize to dict
312
313
  :param exclude_field: Shorthand for setting repr, compare, iter and serialize to False
314
+ :param private: Short for init, repr, compare, iter, serialize = False, must have default or factory
313
315
  :param doc: Parameter documentation for slotted classes
314
316
  :param type: Type of this attribute (for slotted classes)
315
317
 
@@ -321,6 +323,15 @@ def attribute(
321
323
  iter = False
322
324
  serialize = False
323
325
 
326
+ if private:
327
+ if default is NOTHING and default_factory is NOTHING:
328
+ raise AttributeError("Private attributes must have defaults or factories.")
329
+ init = False
330
+ repr = False
331
+ compare = False
332
+ iter = False
333
+ serialize = False
334
+
324
335
  return Attribute(
325
336
  default=default,
326
337
  default_factory=default_factory,
@@ -81,6 +81,7 @@ def attribute(
81
81
  kw_only: bool = False,
82
82
  serialize: bool = True,
83
83
  exclude_field: bool = False,
84
+ private: bool = False,
84
85
  ) -> Attribute: ...
85
86
 
86
87
  def prefab_gatherer(cls_or_ns: type | MappingProxyType) -> tuple[dict[str, Attribute], dict[str, typing.Any]]: ...
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ducktools-classbuilder
3
- Version: 0.6.2
3
+ Version: 0.6.3
4
4
  Summary: Toolkit for creating class boilerplate generators
5
5
  Author: David C Ellis
6
6
  License: MIT License
@@ -0,0 +1,12 @@
1
+ ducktools/classbuilder/__init__.py,sha256=cU3AdLjUWlYA_yUo5uMv2CyrzYNbnnZogsOVAmCn-Dw,32820
2
+ ducktools/classbuilder/__init__.pyi,sha256=JaAfc6y4Jj920y4lm9peduNXeb9XUJwKN-QqFpqG5pw,7924
3
+ ducktools/classbuilder/annotations.py,sha256=17g1WnWfyMWBHKQp2HD_hvV-n7CKXy_zv8NTODpOsuU,5437
4
+ ducktools/classbuilder/annotations.pyi,sha256=cTZQ-pp2IkfdvwHiU3pIySUzzBKxfOtO-e5PkA8TNwo,520
5
+ ducktools/classbuilder/prefab.py,sha256=C70mxApT6pOe18Clz9sCajWWdhHTJjMAyjx2zVZPJew,23696
6
+ ducktools/classbuilder/prefab.pyi,sha256=iZsrju2sU_5_rOoNFrG4-vNTRrZr3dSxWNzmHd2BuYw,4387
7
+ ducktools/classbuilder/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
8
+ ducktools_classbuilder-0.6.3.dist-info/LICENSE.md,sha256=6Thz9Dbw8R4fWInl6sGl8Rj3UnKnRbDwrc6jZerpugQ,1070
9
+ ducktools_classbuilder-0.6.3.dist-info/METADATA,sha256=Qxqxy6400PNSK2wb1pEHx_99rKVSym70110QesZtdnc,10911
10
+ ducktools_classbuilder-0.6.3.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
11
+ ducktools_classbuilder-0.6.3.dist-info/top_level.txt,sha256=uSDLtio3ZFqdwcsMJ2O5yhjB4Q3ytbBWbA8rJREganc,10
12
+ ducktools_classbuilder-0.6.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.2.0)
2
+ Generator: setuptools (70.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,12 +0,0 @@
1
- ducktools/classbuilder/__init__.py,sha256=9IBwSOSXY9SFbbV6msfS9oUx2BneNrQvjZsb-iLSLZ4,32820
2
- ducktools/classbuilder/__init__.pyi,sha256=JaAfc6y4Jj920y4lm9peduNXeb9XUJwKN-QqFpqG5pw,7924
3
- ducktools/classbuilder/annotations.py,sha256=17g1WnWfyMWBHKQp2HD_hvV-n7CKXy_zv8NTODpOsuU,5437
4
- ducktools/classbuilder/annotations.pyi,sha256=cTZQ-pp2IkfdvwHiU3pIySUzzBKxfOtO-e5PkA8TNwo,520
5
- ducktools/classbuilder/prefab.py,sha256=LCrnS2zKADX5FS0SdzCYLF4n5yR43CIlv2QLL6PDjl4,23292
6
- ducktools/classbuilder/prefab.pyi,sha256=kmqZcP2aGHEAb3-cLCBlYi6gclzsQAAmY7cnHvKT7jQ,4360
7
- ducktools/classbuilder/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
8
- ducktools_classbuilder-0.6.2.dist-info/LICENSE.md,sha256=6Thz9Dbw8R4fWInl6sGl8Rj3UnKnRbDwrc6jZerpugQ,1070
9
- ducktools_classbuilder-0.6.2.dist-info/METADATA,sha256=fGjzXJdePiVfTkzZozk9-HHFW-zZJakoPnBrTmMepAE,10911
10
- ducktools_classbuilder-0.6.2.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
11
- ducktools_classbuilder-0.6.2.dist-info/top_level.txt,sha256=uSDLtio3ZFqdwcsMJ2O5yhjB4Q3ytbBWbA8rJREganc,10
12
- ducktools_classbuilder-0.6.2.dist-info/RECORD,,