private-attribute-cpp 1.0.2__tar.gz → 1.0.8__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.

Potentially problematic release.


This version of private-attribute-cpp might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: private_attribute_cpp
3
- Version: 1.0.2
3
+ Version: 1.0.8
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
 
@@ -35,15 +35,9 @@ class MyClass(PrivateAttrBase, private_func=my_generate_func): # 3 Inherit +
35
35
  inner(...)
36
36
  return heavy_computation(self.a, self.b, self.c, x)
37
37
 
38
- @expensive_api_call.non_conflict_attr_name1 # 6 Easy access to internal names
39
- @expensive_api_call.non_conflict_attr_name2 # 6 Easy use when the name has no conflict
40
- @PrivateWrapProxy(lambda f: f) # 5 dummy wrapper just to restore order
41
- def expensive_api_call(self, x): # Second definition (will be wrapped)
42
- return heavy_computation(self.a, self.b, self.c, x)
43
-
44
38
  # Fix decorator order + resolve name conflicts
45
- @PrivateWrapProxy(expensive_api_call.result.conflicted_name2, expensive_api_call) # 7 Chain .result to push decorators down
46
- @PrivateWrapProxy(expensive_api_call.result.conflicted_name1, expensive_api_call) # 7 Resolve conflict with internal names
39
+ @PrivateWrapProxy(expensive_api_call.result.name2, expensive_api_call) # 6 Chain .result to push decorators down
40
+ @PrivateWrapProxy(expensive_api_call.result.name1, expensive_api_call) # 6 Resolve conflict with internal names
47
41
  def expensive_api_call(self, x): # Final real implementation
48
42
  return heavy_computation(self.a, self.b, self.c, x)
49
43
 
@@ -64,8 +58,7 @@ print(obj.expensive_api_call(10)) # works with all decorators applied
64
58
  | 3 | Pass private_func in class definition | Same as above | Optional |
65
59
  | 4 | \_\_private_attrs\_\_ list | Declare which attributes are private | Yes |
66
60
  | 5 | @PrivateWrapProxy(...) | Make any decorator compatible with private attributes | When needed |
67
- | 6 | method.xxx | Normal api name proxy | Based on its api |
68
- | 7 | method.result.xxx chain + dummy wrap | Fix decorator order and name conflicts | When needed |
61
+ | 6 | method.result.xxx chain + dummy wrap | Fix decorator order and name conflicts | When needed |
69
62
 
70
63
  ## Usage
71
64