private-attribute-cpp 1.0.1__cp311-cp311-win_amd64.whl → 1.0.11__cp311-cp311-win_amd64.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.
Binary file
private_attribute.pyi CHANGED
@@ -15,4 +15,8 @@ class PrivateWrapProxy:
15
15
  def __call__(self, func: Any) -> _PrivateWrap[T]: ...
16
16
 
17
17
  class PrivateAttrType(type):
18
- def __new__(cls, name: str, bases: tuple, attrs: PrivateAttrDict, private_func: Callable[[int, str], str]|None = None) -> PrivateAttrType: ...
18
+ def __new__(cls, name: str, bases: tuple, attrs: PrivateAttrDict, private_func: Callable[[int, str], str]|None = None) -> PrivateAttrType: ...
19
+
20
+ class PrivateAttrBase(metaclass=PrivateAttrType):
21
+ __slots__ = ()
22
+ __private_attrs__ = ()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: private_attribute_cpp
3
- Version: 1.0.1
3
+ Version: 1.0.11
4
4
  Summary: A Python package that provides a way to define private attributes in C++ implementation.
5
5
  Home-page: https://github.com/Locked-chess-official/private_attribute_cpp
6
6
  Author: HuangHaoHua
@@ -52,15 +52,9 @@ class MyClass(PrivateAttrBase, private_func=my_generate_func): # 3 Inherit +
52
52
  inner(...)
53
53
  return heavy_computation(self.a, self.b, self.c, x)
54
54
 
55
- @expensive_api_call.non_conflict_attr_name1 # 6 Easy access to internal names
56
- @expensive_api_call.non_conflict_attr_name2 # 6 Easy use when the name has no conflict
57
- @PrivateWrapProxy(lambda f: f) # 5 dummy wrapper just to restore order
58
- def expensive_api_call(self, x): # Second definition (will be wrapped)
59
- return heavy_computation(self.a, self.b, self.c, x)
60
-
61
55
  # Fix decorator order + resolve name conflicts
62
- @PrivateWrapProxy(expensive_api_call.result.conflicted_name2, expensive_api_call) # 7 Chain .result to push decorators down
63
- @PrivateWrapProxy(expensive_api_call.result.conflicted_name1, expensive_api_call) # 7 Resolve conflict with internal names
56
+ @PrivateWrapProxy(expensive_api_call.result.name2, expensive_api_call) # 6 Chain .result to push decorators down
57
+ @PrivateWrapProxy(expensive_api_call.result.name1, expensive_api_call) # 6 Resolve conflict with internal names
64
58
  def expensive_api_call(self, x): # Final real implementation
65
59
  return heavy_computation(self.a, self.b, self.c, x)
66
60
 
@@ -81,8 +75,7 @@ print(obj.expensive_api_call(10)) # works with all decorators applied
81
75
  | 3 | Pass private_func in class definition | Same as above | Optional |
82
76
  | 4 | \_\_private_attrs\_\_ list | Declare which attributes are private | Yes |
83
77
  | 5 | @PrivateWrapProxy(...) | Make any decorator compatible with private attributes | When needed |
84
- | 6 | method.xxx | Normal api name proxy | Based on its api |
85
- | 7 | method.result.xxx chain + dummy wrap | Fix decorator order and name conflicts | When needed |
78
+ | 6 | method.result.xxx chain + dummy wrap | Fix decorator order and name conflicts | When needed |
86
79
 
87
80
  ## Usage
88
81
 
@@ -0,0 +1,6 @@
1
+ private_attribute.cp311-win_amd64.pyd,sha256=BhVbhpKvFFnCz0PZzBbhax_TC_y6XDndGhnhBHqx9Dw,177664
2
+ private_attribute.pyi,sha256=pWpoUdy38dA12n8wyE-knOtoQAd7ENj-f14pxwyHijQ,804
3
+ private_attribute_cpp-1.0.11.dist-info/METADATA,sha256=p5pL0jWFT-3Z7R88-d6sALWz8Flh23AjGCJv3FvbdLc,7410
4
+ private_attribute_cpp-1.0.11.dist-info/WHEEL,sha256=JLOMsP7F5qtkAkINx5UnzbFguf8CqZeraV8o04b0I8I,101
5
+ private_attribute_cpp-1.0.11.dist-info/top_level.txt,sha256=vOfJKfFO3AgjCIvyK6ppYDBTyJSsEAkf5w34knGZ3JE,19
6
+ private_attribute_cpp-1.0.11.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- private_attribute.cp311-win_amd64.pyd,sha256=v2TrzUGYNcj-7XQYoCefu1W3NTiCebxqS5MC7Bfmm0c,166912
2
- private_attribute.pyi,sha256=HJKzlAC5tD25DH6sjbq4Zv_Vzvwaw-WaW7hBaqchIZ4,701
3
- private_attribute_cpp-1.0.1.dist-info/METADATA,sha256=vY-kDeVtpnFW0btaqwOM2O9KcHmGg1UlN8EgOq2Y9Mo,7984
4
- private_attribute_cpp-1.0.1.dist-info/WHEEL,sha256=JLOMsP7F5qtkAkINx5UnzbFguf8CqZeraV8o04b0I8I,101
5
- private_attribute_cpp-1.0.1.dist-info/top_level.txt,sha256=vOfJKfFO3AgjCIvyK6ppYDBTyJSsEAkf5w34knGZ3JE,19
6
- private_attribute_cpp-1.0.1.dist-info/RECORD,,