private-attribute-cpp 3.0.2__tar.gz → 3.0.4__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-3.0.2/README.md → private_attribute_cpp-3.0.4/PKG-INFO +10 -11
- private_attribute_cpp-3.0.2/PKG-INFO → private_attribute_cpp-3.0.4/README.md +0 -21
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/private_attribute.cpp +567 -496
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/private_attribute.pyi +1 -24
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/pyproject.toml +1 -1
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/CMakeLists.txt +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/LICENSE +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/picosha2.h +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/tests/test_attr_classify_owner.py +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/tests/test_class_private_attrs.py +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/tests/test_gc_collect.py +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/tests/test_init_subclass.py +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/tests/test_private_abc.py +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/tests/test_private_attrs.py +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/tests/test_private_func.py +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/tests/test_private_inheritance.py +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/tests/test_private_method.py +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/tests/test_private_super.py +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/tests/test_private_wrap.py +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/tests/test_slots_cycle.py +0 -0
- {private_attribute_cpp-3.0.2 → private_attribute_cpp-3.0.4}/tests/test_use_parents.py +0 -0
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: private_attribute_cpp
|
|
3
|
+
Version: 3.0.4
|
|
4
|
+
Summary: A Python package that provides a way to define private attributes in C++ implementation.
|
|
5
|
+
Author-Email: HuangHaoHua <13140752715@example.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Locked-chess-official/private_attribute_cpp
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
1
11
|
# private_attribute_cpp
|
|
2
12
|
|
|
3
13
|
[](https://pypi.org/project/private-attribute-cpp/)
|
|
@@ -388,10 +398,6 @@ class MyClass(private_attribute.PrivateAttrBase):
|
|
|
388
398
|
__setattr__ = private_attribute.create_slot("__setattr__")()
|
|
389
399
|
```
|
|
390
400
|
|
|
391
|
-
> The old `prepare` / `postprocess` pair and `register_metaclass` are
|
|
392
|
-
> deprecated (they emit a warning) and kept only for backward compatibility;
|
|
393
|
-
> new code should use `create_new`.
|
|
394
|
-
|
|
395
401
|
---
|
|
396
402
|
|
|
397
403
|
## Behavioral notes & limitations
|
|
@@ -418,11 +424,6 @@ class MyClass(private_attribute.PrivateAttrBase):
|
|
|
418
424
|
- **v2.2.0** — a subclass must not define, in its own class body, a name that is
|
|
419
425
|
private to a parent, unless it declares the name in its own
|
|
420
426
|
`__private_attrs__` or opts in with `use_parents=True`.
|
|
421
|
-
- **v2.2.1** — `prepare` locks private-attribute-type creation so only one type
|
|
422
|
-
is being built (`type.__new__`) at a time; `postprocess` unlocks it. The lock
|
|
423
|
-
is released automatically on failure. (Deprecated; see `create_new`.)
|
|
424
|
-
- **v2.2.3** — prefer the `with` form of `prepare`/`postprocess` to guarantee
|
|
425
|
-
the lock is released. (Deprecated; see `create_new`.)
|
|
426
427
|
- CPython may reset the special-method slot descriptors (e.g. when you assign
|
|
427
428
|
`__getattribute__` / `__setattr__`). Use `ensure_type` (or
|
|
428
429
|
`ensure_metaclass`) to re-inject them, and avoid setting those methods on
|
|
@@ -435,8 +436,6 @@ class MyClass(private_attribute.PrivateAttrBase):
|
|
|
435
436
|
id records attribute names already confirmed non-private, so they go
|
|
436
437
|
straight to the user callback without re-classification. Registered types and
|
|
437
438
|
created types must be heap types (static types are rejected).
|
|
438
|
-
- `register_metaclass` requires a metaclass that supports weak references.
|
|
439
|
-
(Deprecated; use `create_new`, which registers the metaclass automatically.)
|
|
440
439
|
- Do **not** set `__static_attributes__` on a private-attribute class; it is
|
|
441
440
|
removed automatically.
|
|
442
441
|
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: private_attribute_cpp
|
|
3
|
-
Version: 3.0.2
|
|
4
|
-
Summary: A Python package that provides a way to define private attributes in C++ implementation.
|
|
5
|
-
Author-Email: HuangHaoHua <13140752715@example.com>
|
|
6
|
-
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/Locked-chess-official/private_attribute_cpp
|
|
8
|
-
Requires-Python: >=3.10
|
|
9
|
-
Description-Content-Type: text/markdown
|
|
10
|
-
|
|
11
1
|
# private_attribute_cpp
|
|
12
2
|
|
|
13
3
|
[](https://pypi.org/project/private-attribute-cpp/)
|
|
@@ -398,10 +388,6 @@ class MyClass(private_attribute.PrivateAttrBase):
|
|
|
398
388
|
__setattr__ = private_attribute.create_slot("__setattr__")()
|
|
399
389
|
```
|
|
400
390
|
|
|
401
|
-
> The old `prepare` / `postprocess` pair and `register_metaclass` are
|
|
402
|
-
> deprecated (they emit a warning) and kept only for backward compatibility;
|
|
403
|
-
> new code should use `create_new`.
|
|
404
|
-
|
|
405
391
|
---
|
|
406
392
|
|
|
407
393
|
## Behavioral notes & limitations
|
|
@@ -428,11 +414,6 @@ class MyClass(private_attribute.PrivateAttrBase):
|
|
|
428
414
|
- **v2.2.0** — a subclass must not define, in its own class body, a name that is
|
|
429
415
|
private to a parent, unless it declares the name in its own
|
|
430
416
|
`__private_attrs__` or opts in with `use_parents=True`.
|
|
431
|
-
- **v2.2.1** — `prepare` locks private-attribute-type creation so only one type
|
|
432
|
-
is being built (`type.__new__`) at a time; `postprocess` unlocks it. The lock
|
|
433
|
-
is released automatically on failure. (Deprecated; see `create_new`.)
|
|
434
|
-
- **v2.2.3** — prefer the `with` form of `prepare`/`postprocess` to guarantee
|
|
435
|
-
the lock is released. (Deprecated; see `create_new`.)
|
|
436
417
|
- CPython may reset the special-method slot descriptors (e.g. when you assign
|
|
437
418
|
`__getattribute__` / `__setattr__`). Use `ensure_type` (or
|
|
438
419
|
`ensure_metaclass`) to re-inject them, and avoid setting those methods on
|
|
@@ -445,8 +426,6 @@ class MyClass(private_attribute.PrivateAttrBase):
|
|
|
445
426
|
id records attribute names already confirmed non-private, so they go
|
|
446
427
|
straight to the user callback without re-classification. Registered types and
|
|
447
428
|
created types must be heap types (static types are rejected).
|
|
448
|
-
- `register_metaclass` requires a metaclass that supports weak references.
|
|
449
|
-
(Deprecated; use `create_new`, which registers the metaclass automatically.)
|
|
450
429
|
- Do **not** set `__static_attributes__` on a private-attribute class; it is
|
|
451
430
|
removed automatically.
|
|
452
431
|
|