private-attribute-cpp 1.2.10__tar.gz → 1.3.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: private_attribute_cpp
3
- Version: 1.2.10
3
+ Version: 1.3.1
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
@@ -1337,9 +1337,9 @@ static PyTypeObject PrivateAttrType = {
1337
1337
  (getattrofunc)PrivateAttrType_getattr, // tp_getattro
1338
1338
  (setattrofunc)PrivateAttrType_setattr, // tp_setattro
1339
1339
  0, // tp_as_buffer
1340
- Py_TPFLAGS_DEFAULT, // tp_flags
1340
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, // tp_flags
1341
1341
  "metaclass for private attributes", // tp_doc
1342
- 0, // tp_traverse
1342
+ 0, // tp_travers
1343
1343
  0, // tp_clear
1344
1344
  0, // tp_richcompare
1345
1345
  0, // tp_weaklistoffset
@@ -2000,7 +2000,7 @@ static void
2000
2000
  ensure_subclass_tp(PyTypeObject* type_instance)
2001
2001
  {
2002
2002
  // type.__subclasses__
2003
- PyObject* type_subclasses = PyObject_CallMethodNoArgs((PyObject*)type_instance, PyUnicode_FromString("__subclasses__"));
2003
+ PyObject* type_subclasses = (PyObject*)type_instance->tp_subclasses;
2004
2004
  if (!type_subclasses) {
2005
2005
  PyErr_Clear();
2006
2006
  return;
@@ -2041,7 +2041,7 @@ PrivateAttrType_postprocess(PyObject* new_type, PrivateAttrCreationData& data)
2041
2041
  std::vector<uintptr_t> mro_vector;
2042
2042
  for (Py_ssize_t i = 1; i < mro_size; i++) {
2043
2043
  PyObject* item = PyTuple_GET_ITEM(mro, i);
2044
- if (!item || !PyType_Check(item) || !PyObject_IsInstance(item, (PyObject*)&PrivateAttrType)) {
2044
+ if (!item || !PyType_Check(item) || !need_analyse_type(item)) {
2045
2045
  continue;
2046
2046
  }
2047
2047
  mro_vector.push_back((uintptr_t)item);
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: private_attribute_cpp
3
- Version: 1.2.10
3
+ Version: 1.3.1
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.2.10',
22
+ version='1.3.1',
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.',