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.
- {private_attribute_cpp-1.0.2/private_attribute_cpp.egg-info → private_attribute_cpp-1.0.8}/PKG-INFO +4 -11
- {private_attribute_cpp-1.0.2 → private_attribute_cpp-1.0.8}/README.md +3 -10
- {private_attribute_cpp-1.0.2 → private_attribute_cpp-1.0.8}/private_attribute.cpp +842 -671
- {private_attribute_cpp-1.0.2 → private_attribute_cpp-1.0.8}/private_attribute.pyi +5 -1
- {private_attribute_cpp-1.0.2 → private_attribute_cpp-1.0.8/private_attribute_cpp.egg-info}/PKG-INFO +4 -11
- {private_attribute_cpp-1.0.2 → private_attribute_cpp-1.0.8}/setup.py +1 -1
- {private_attribute_cpp-1.0.2 → private_attribute_cpp-1.0.8}/MANIFEST.in +0 -0
- {private_attribute_cpp-1.0.2 → private_attribute_cpp-1.0.8}/picosha2.h +0 -0
- {private_attribute_cpp-1.0.2 → private_attribute_cpp-1.0.8}/private_attribute_cpp.egg-info/SOURCES.txt +0 -0
- {private_attribute_cpp-1.0.2 → private_attribute_cpp-1.0.8}/private_attribute_cpp.egg-info/dependency_links.txt +0 -0
- {private_attribute_cpp-1.0.2 → private_attribute_cpp-1.0.8}/private_attribute_cpp.egg-info/not-zip-safe +0 -0
- {private_attribute_cpp-1.0.2 → private_attribute_cpp-1.0.8}/private_attribute_cpp.egg-info/top_level.txt +0 -0
- {private_attribute_cpp-1.0.2 → private_attribute_cpp-1.0.8}/setup.cfg +0 -0
{private_attribute_cpp-1.0.2/private_attribute_cpp.egg-info → private_attribute_cpp-1.0.8}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: private_attribute_cpp
|
|
3
|
-
Version: 1.0.
|
|
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.
|
|
63
|
-
@PrivateWrapProxy(expensive_api_call.result.
|
|
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 |
|
|
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.
|
|
46
|
-
@PrivateWrapProxy(expensive_api_call.result.
|
|
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 |
|
|
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
|
|