private-attribute-cpp 2.1.22__tar.gz → 2.1.23__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.
Files changed (24) hide show
  1. {private_attribute_cpp-2.1.22/private_attribute_cpp.egg-info → private_attribute_cpp-2.1.23}/PKG-INFO +1 -1
  2. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/private_attribute.cpp +23 -51
  3. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/private_attribute.pyi +1 -1
  4. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23/private_attribute_cpp.egg-info}/PKG-INFO +1 -1
  5. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/setup.py +1 -1
  6. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/LICENSE +0 -0
  7. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/MANIFEST.in +0 -0
  8. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/README.md +0 -0
  9. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/picosha2.h +0 -0
  10. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/private_attribute_cpp.egg-info/SOURCES.txt +0 -0
  11. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/private_attribute_cpp.egg-info/dependency_links.txt +0 -0
  12. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/private_attribute_cpp.egg-info/not-zip-safe +0 -0
  13. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/private_attribute_cpp.egg-info/top_level.txt +0 -0
  14. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/setup.cfg +0 -0
  15. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/tests/test_attr_classify_owner.py +0 -0
  16. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/tests/test_class_private_attrs.py +0 -0
  17. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/tests/test_gc_collect.py +0 -0
  18. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/tests/test_private_abc.py +0 -0
  19. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/tests/test_private_attrs.py +0 -0
  20. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/tests/test_private_func.py +0 -0
  21. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/tests/test_private_inheritance.py +0 -0
  22. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/tests/test_private_method.py +0 -0
  23. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/tests/test_private_wrap.py +0 -0
  24. {private_attribute_cpp-2.1.22 → private_attribute_cpp-2.1.23}/tests/test_slots_cycle.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: private_attribute_cpp
3
- Version: 2.1.22
3
+ Version: 2.1.23
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
@@ -3854,7 +3854,7 @@ PrivateAttrType_del(PyObject* cls) noexcept
3854
3854
  PyType_Type.tp_dealloc(cls);
3855
3855
  }
3856
3856
 
3857
- static const char* PrivateAttrBase_doc = "The class to help to create private attribute. It does not have any special behavior.";
3857
+ static const char* PrivateAttrBase_doc = "The class to help creating private attribute. It does not have any special behavior.";
3858
3858
 
3859
3859
  // PrivateAttrBase
3860
3860
  static PyObject*
@@ -4374,50 +4374,33 @@ PrivateModule_get_PrivateAttrBase(PyObject* /*self*/, void* /*closure*/) noexcep
4374
4374
  return NULL;
4375
4375
  }
4376
4376
  AllData::store_module_self[AllData::kPrivateAttrBaseKey] = base;
4377
- Py_DECREF(base);
4378
- it = AllData::store_module_self.find(AllData::kPrivateAttrBaseKey);
4377
+ return base;
4379
4378
  }
4380
4379
  PyObject* PrivateAttrBase = it->second.get();
4381
4380
  Py_INCREF(PrivateAttrBase);
4382
4381
  return PrivateAttrBase;
4383
4382
  }
4384
4383
 
4385
- static int
4386
- PyList_AppendString(PyObject* list, const char* str) noexcept
4387
- {
4388
- PyObject* obj = PyUnicode_InternFromString(str);
4389
- if (!obj) return -1;
4390
- if (PyList_Append(list, obj) < 0) {
4391
- Py_DECREF(obj);
4392
- return -1;
4393
- }
4394
- Py_DECREF(obj);
4395
- return 0;
4396
- }
4397
-
4398
- #define DIR_CHECK(command) do {if (command < 0) goto finally;} while (0)
4399
-
4400
4384
  static PyObject*
4401
4385
  PrivateModule_dir(PyObject* self, PyObject* /*args*/) noexcept
4402
4386
  {
4403
4387
  PyObject* parent_dir = PyObject_CallMethod((PyObject*)&PyModule_Type, "__dir__", "O", self);
4404
4388
  if (!parent_dir) return NULL;
4405
- PyObject* attr_list = PyList_New(0);
4389
+ PyObject* attr_list = Py_BuildValue("[ssssssss]",
4390
+ "PrivateWrapProxy",
4391
+ "PrivateAttrType",
4392
+ "PrivateAttrBase",
4393
+ "prepare",
4394
+ "postprocess",
4395
+ "register_metaclass",
4396
+ "ensure_type",
4397
+ "ensure_metaclass"
4398
+ );
4406
4399
  if (!attr_list) {
4407
4400
  Py_DECREF(parent_dir);
4408
4401
  return NULL;
4409
4402
  }
4410
- PyObject* result = NULL;
4411
- DIR_CHECK(PyList_AppendString(attr_list, "PrivateWrapProxy"));
4412
- DIR_CHECK(PyList_AppendString(attr_list, "PrivateAttrType"));
4413
- DIR_CHECK(PyList_AppendString(attr_list, "PrivateAttrBase"));
4414
- DIR_CHECK(PyList_AppendString(attr_list, "prepare"));
4415
- DIR_CHECK(PyList_AppendString(attr_list, "postprocess"));
4416
- DIR_CHECK(PyList_AppendString(attr_list, "register_metaclass"));
4417
- DIR_CHECK(PyList_AppendString(attr_list, "ensure_type"));
4418
- DIR_CHECK(PyList_AppendString(attr_list, "ensure_metaclass"));
4419
- result = PySequence_Concat(parent_dir, attr_list);
4420
- finally:
4403
+ PyObject* result = PySequence_Concat(parent_dir, attr_list);
4421
4404
  Py_DECREF(parent_dir);
4422
4405
  Py_DECREF(attr_list);
4423
4406
  return result;
@@ -4716,8 +4699,6 @@ PrivateModule_create(PyObject* spec, PyModuleDef* /*def*/) noexcept
4716
4699
  return m;
4717
4700
  }
4718
4701
 
4719
- #define MODULE_EXEC_CHECK(command) do {if (command < 0) {return -1;}} while(0)
4720
-
4721
4702
  static int
4722
4703
  PrivateModule_exec(PyObject* m) noexcept
4723
4704
  {
@@ -4730,7 +4711,16 @@ PrivateModule_exec(PyObject* m) noexcept
4730
4711
  return -1;
4731
4712
  }
4732
4713
  Py_DECREF(private_attr_base);
4733
- PyObject* all = PyList_New(0);
4714
+ PyObject* all = Py_BuildValue("[ssssssss]",
4715
+ "PrivateWrapProxy",
4716
+ "PrivateAttrType",
4717
+ "PrivateAttrBase",
4718
+ "prepare",
4719
+ "postprocess",
4720
+ "register_metaclass",
4721
+ "ensure_type",
4722
+ "ensure_metaclass"
4723
+ );
4734
4724
  if (!all) {
4735
4725
  return -1;
4736
4726
  }
@@ -4738,24 +4728,6 @@ PrivateModule_exec(PyObject* m) noexcept
4738
4728
  Py_DECREF(all);
4739
4729
  return -1;
4740
4730
  }
4741
- /* all contains:
4742
- * PrivateWrapProxy
4743
- * PrivateAttrType
4744
- * PrivateAttrBase
4745
- * prepare
4746
- * postprocess
4747
- * register_metaclass
4748
- * ensure_type
4749
- * ensure_metaclass
4750
- */
4751
- MODULE_EXEC_CHECK(PyList_AppendString(all, "PrivateWrapProxy"));
4752
- MODULE_EXEC_CHECK(PyList_AppendString(all, "PrivateAttrType"));
4753
- MODULE_EXEC_CHECK(PyList_AppendString(all, "PrivateAttrBase"));
4754
- MODULE_EXEC_CHECK(PyList_AppendString(all, "prepare"));
4755
- MODULE_EXEC_CHECK(PyList_AppendString(all, "postprocess"));
4756
- MODULE_EXEC_CHECK(PyList_AppendString(all, "register_metaclass"));
4757
- MODULE_EXEC_CHECK(PyList_AppendString(all, "ensure_type"));
4758
- MODULE_EXEC_CHECK(PyList_AppendString(all, "ensure_metaclass"));
4759
4731
 
4760
4732
  AllData::store_module_self[AllData::kModuleSelfKey] = m; // store module self
4761
4733
 
@@ -102,7 +102,7 @@ class PrivateAttrType(type):
102
102
  private_func: Callable[[int, str], str]|None = None) -> PrivateAttrType: ...
103
103
 
104
104
  class PrivateAttrBase(metaclass=PrivateAttrType):
105
- "The class to help to create private attribute. It does not have any special behavior."
105
+ "The class to help creating private attribute. It does not have any special behavior."
106
106
  __slots__ = ()
107
107
  __private_attrs__ = ()
108
108
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: private_attribute_cpp
3
- Version: 2.1.22
3
+ Version: 2.1.23
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
@@ -24,7 +24,7 @@ readme = open('README.md').read()
24
24
 
25
25
  setup(
26
26
  name='private_attribute_cpp',
27
- version='2.1.22',
27
+ version='2.1.23',
28
28
  author="HuangHaoHua",
29
29
  author_email="13140752715@example.com",
30
30
  description='A Python package that provides a way to define private attributes in C++ implementation.',