private-attribute-cpp 1.3.5__tar.gz → 1.3.6__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.
- {private_attribute_cpp-1.3.5/private_attribute_cpp.egg-info → private_attribute_cpp-1.3.6}/PKG-INFO +1 -1
- {private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6}/private_attribute.cpp +15 -5
- {private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6/private_attribute_cpp.egg-info}/PKG-INFO +1 -1
- {private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6}/setup.py +1 -1
- {private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6}/LICENSE +0 -0
- {private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6}/MANIFEST.in +0 -0
- {private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6}/README.md +0 -0
- {private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6}/picosha2.h +0 -0
- {private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6}/private_attribute.pyi +0 -0
- {private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6}/private_attribute_cpp.egg-info/SOURCES.txt +0 -0
- {private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6}/private_attribute_cpp.egg-info/dependency_links.txt +0 -0
- {private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6}/private_attribute_cpp.egg-info/not-zip-safe +0 -0
- {private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6}/private_attribute_cpp.egg-info/top_level.txt +0 -0
- {private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6}/setup.cfg +0 -0
{private_attribute_cpp-1.3.5/private_attribute_cpp.egg-info → private_attribute_cpp-1.3.6}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: private_attribute_cpp
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.6
|
|
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
|
|
@@ -61,7 +61,8 @@ public:
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
class TwoStringTuple
|
|
64
|
+
class TwoStringTuple
|
|
65
|
+
{
|
|
65
66
|
private:
|
|
66
67
|
std::string first;
|
|
67
68
|
std::string second;
|
|
@@ -127,7 +128,8 @@ namespace {
|
|
|
127
128
|
};
|
|
128
129
|
};
|
|
129
130
|
|
|
130
|
-
struct FinalObject
|
|
131
|
+
struct FinalObject
|
|
132
|
+
{
|
|
131
133
|
PyObject* result = NULL;
|
|
132
134
|
int status = 0;
|
|
133
135
|
FinalObject(PyObject* result)
|
|
@@ -1669,7 +1671,8 @@ real_class_name(std::string name, std::string class_name)
|
|
|
1669
1671
|
return name;
|
|
1670
1672
|
}
|
|
1671
1673
|
|
|
1672
|
-
struct PrivateAttrCreationData
|
|
1674
|
+
struct PrivateAttrCreationData
|
|
1675
|
+
{
|
|
1673
1676
|
std::string class_name;
|
|
1674
1677
|
PyObject* attrs_copy = nullptr;
|
|
1675
1678
|
PyObject* new_hash_private_attrs = nullptr;
|
|
@@ -2209,8 +2212,14 @@ PrivateAttrType_setattr(PyObject* cls, PyObject* name, PyObject* value)
|
|
|
2209
2212
|
PyErr_SetString(PyExc_TypeError, "cls must be a type");
|
|
2210
2213
|
return -1;
|
|
2211
2214
|
}
|
|
2215
|
+
// check Py_TPFLAGS_IMMUTABLETYPE
|
|
2212
2216
|
uintptr_t typ_id = (uintptr_t)(cls);
|
|
2213
2217
|
std::string name_str = PyUnicode_AsUTF8(name);
|
|
2218
|
+
if (((PyTypeObject*)cls)->tp_flags & Py_TPFLAGS_IMMUTABLETYPE) {
|
|
2219
|
+
std::string error_message = "cannot set '" + name_str + "' attribute of immutable type '" + ((PyTypeObject*)cls)->tp_name + "'";
|
|
2220
|
+
PyErr_SetString(PyExc_TypeError, error_message.c_str());
|
|
2221
|
+
return -1;
|
|
2222
|
+
}
|
|
2214
2223
|
PyCodeObject* now_code = get_now_code();
|
|
2215
2224
|
if (type_private_attr(typ_id, name_str)) {
|
|
2216
2225
|
if (!now_code || (!is_class_code(typ_id, now_code) && !is_subclass_code(typ_id, now_code))) {
|
|
@@ -2484,7 +2493,8 @@ prepare_for_PrivateAttr(PyObject* /*self*/, PyObject* args, PyObject* kwargs)
|
|
|
2484
2493
|
}
|
|
2485
2494
|
|
|
2486
2495
|
static PyObject*
|
|
2487
|
-
postprocess_for_PrivateAttr(PyObject* /*self*/, PyObject* args)
|
|
2496
|
+
postprocess_for_PrivateAttr(PyObject* /*self*/, PyObject* args)
|
|
2497
|
+
{
|
|
2488
2498
|
PyObject* type;
|
|
2489
2499
|
PyObject* tmp;
|
|
2490
2500
|
if (!PyArg_ParseTuple(args, "OO", &type, &tmp)) {
|
|
@@ -2769,7 +2779,7 @@ PyInit_private_attribute(void)
|
|
|
2769
2779
|
PyType_Ready(&PrivateWrapProxyType) < 0 ||
|
|
2770
2780
|
PyType_Ready(&PrivateAttrType) < 0 ||
|
|
2771
2781
|
PyType_Ready(&PrivateModuleType) < 0 ||
|
|
2772
|
-
PyType_Ready(&PrivateTempType)) {
|
|
2782
|
+
PyType_Ready(&PrivateTempType) < 0) {
|
|
2773
2783
|
return NULL;
|
|
2774
2784
|
}
|
|
2775
2785
|
|
{private_attribute_cpp-1.3.5 → private_attribute_cpp-1.3.6/private_attribute_cpp.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: private_attribute_cpp
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.6
|
|
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
|
|
@@ -19,7 +19,7 @@ readme = open('README.md').read()
|
|
|
19
19
|
|
|
20
20
|
setup(
|
|
21
21
|
name='private_attribute_cpp',
|
|
22
|
-
version='1.3.
|
|
22
|
+
version='1.3.6',
|
|
23
23
|
author="HuangHaoHua",
|
|
24
24
|
author_email="13140752715@example.com",
|
|
25
25
|
description='A Python package that provides a way to define private attributes in C++ implementation.',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|