cutienator 0.0.1.dev0__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 (60) hide show
  1. cutienator-0.0.1.dev0/LICENSE +201 -0
  2. cutienator-0.0.1.dev0/PKG-INFO +33 -0
  3. cutienator-0.0.1.dev0/README.md +4 -0
  4. cutienator-0.0.1.dev0/pyproject.toml +60 -0
  5. cutienator-0.0.1.dev0/setup.cfg +4 -0
  6. cutienator-0.0.1.dev0/src/cutienator/__init__.py +44 -0
  7. cutienator-0.0.1.dev0/src/cutienator/_cpp_addr.py +84 -0
  8. cutienator-0.0.1.dev0/src/cutienator/_cpp_box.py +23 -0
  9. cutienator-0.0.1.dev0/src/cutienator/_cute_load_hook.py +159 -0
  10. cutienator-0.0.1.dev0/src/cutienator/_cute_mixin.py +166 -0
  11. cutienator-0.0.1.dev0/src/cutienator/_cute_overload.py +285 -0
  12. cutienator-0.0.1.dev0/src/cutienator/_cute_space.py +727 -0
  13. cutienator-0.0.1.dev0/src/cutienator/_header_descriptor.py +4 -0
  14. cutienator-0.0.1.dev0/src/cutienator/_meta_cute.py +444 -0
  15. cutienator-0.0.1.dev0/src/cutienator/_q_binding_storage.py +101 -0
  16. cutienator-0.0.1.dev0/src/cutienator/_q_event.py +185 -0
  17. cutienator-0.0.1.dev0/src/cutienator/_q_meta_object.py +118 -0
  18. cutienator-0.0.1.dev0/src/cutienator/_q_object.py +582 -0
  19. cutienator-0.0.1.dev0/src/cutienator/_q_thread.py +106 -0
  20. cutienator-0.0.1.dev0/src/cutienator/_q_widget.py +80 -0
  21. cutienator-0.0.1.dev0/src/cutienator/_ugly.py +296 -0
  22. cutienator-0.0.1.dev0/src/cutienator/_wait.py +303 -0
  23. cutienator-0.0.1.dev0/src/cutienator/_waiting_overload.py +261 -0
  24. cutienator-0.0.1.dev0/src/cutienator/example/__init__.py +21 -0
  25. cutienator-0.0.1.dev0/src/cutienator/example/__main__.py +67 -0
  26. cutienator-0.0.1.dev0/src/cutienator/example/_calls.py +107 -0
  27. cutienator-0.0.1.dev0/src/cutienator/occult/__init__.py +27 -0
  28. cutienator-0.0.1.dev0/src/cutienator/occult/__main__.py +50 -0
  29. cutienator-0.0.1.dev0/src/cutienator/occult/_base_meta_ugly.py +29 -0
  30. cutienator-0.0.1.dev0/src/cutienator/occult/_build.py +561 -0
  31. cutienator-0.0.1.dev0/src/cutienator/occult/_cognito_warning.py +35 -0
  32. cutienator-0.0.1.dev0/src/cutienator/occult/_declaration.py +572 -0
  33. cutienator-0.0.1.dev0/src/cutienator/occult/_header.py +710 -0
  34. cutienator-0.0.1.dev0/src/cutienator/occult/_ritual.py +19 -0
  35. cutienator-0.0.1.dev0/src/cutienator/occult/_rituals.py +594 -0
  36. cutienator-0.0.1.dev0/src/cutienator/occult/_shared_object.py +292 -0
  37. cutienator-0.0.1.dev0/src/cutienator/occult/_symbol.py +162 -0
  38. cutienator-0.0.1.dev0/src/cutienator/occult/rituals/q_event.cpp +70 -0
  39. cutienator-0.0.1.dev0/src/cutienator/occult/rituals/q_meta_object.cpp +173 -0
  40. cutienator-0.0.1.dev0/src/cutienator/occult/rituals/q_object.cpp +178 -0
  41. cutienator-0.0.1.dev0/src/cutienator/trial/__init__.py +25 -0
  42. cutienator-0.0.1.dev0/src/cutienator/trial/__main__.py +59 -0
  43. cutienator-0.0.1.dev0/src/cutienator/trial/_judge.py +589 -0
  44. cutienator-0.0.1.dev0/src/cutienator/trial/_q_object_trials.py +38 -0
  45. cutienator-0.0.1.dev0/src/cutienator/trial/_trial.py +495 -0
  46. cutienator-0.0.1.dev0/src/cutienator/trial/_verdict.py +332 -0
  47. cutienator-0.0.1.dev0/src/cutienator.egg-info/PKG-INFO +33 -0
  48. cutienator-0.0.1.dev0/src/cutienator.egg-info/SOURCES.txt +58 -0
  49. cutienator-0.0.1.dev0/src/cutienator.egg-info/dependency_links.txt +1 -0
  50. cutienator-0.0.1.dev0/src/cutienator.egg-info/requires.txt +1 -0
  51. cutienator-0.0.1.dev0/src/cutienator.egg-info/top_level.txt +1 -0
  52. cutienator-0.0.1.dev0/tests/test_cute_load_hook.py +204 -0
  53. cutienator-0.0.1.dev0/tests/test_cute_overload.py +183 -0
  54. cutienator-0.0.1.dev0/tests/test_cute_space.py +597 -0
  55. cutienator-0.0.1.dev0/tests/test_meta_cute.py +761 -0
  56. cutienator-0.0.1.dev0/tests/test_q_object.py +314 -0
  57. cutienator-0.0.1.dev0/tests/test_wait.py +183 -0
  58. cutienator-0.0.1.dev0/tests/test_wait_bound_elsewhere.py +42 -0
  59. cutienator-0.0.1.dev0/tests/test_wait_settle_raises.py +57 -0
  60. cutienator-0.0.1.dev0/tests/test_waiting_overload.py +151 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.4
2
+ Name: cutienator
3
+ Version: 0.0.1.dev0
4
+ Summary: A vastly superior binding of Qt C++ to Python
5
+ Author-email: Asger Jon Vistisen <asgerjon2@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/AsgerJon/cutienator
8
+ Project-URL: Bug Tracker, https://github.com/AsgerJon/cutienator/issues
9
+ Classifier: Programming Language :: Python :: 3.7
10
+ Classifier: Programming Language :: Python :: 3.8
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Programming Language :: Python :: 3.15
18
+ Classifier: Programming Language :: Python :: Implementation :: CPython
19
+ Classifier: Operating System :: POSIX :: Linux
20
+ Classifier: Development Status :: 2 - Pre-Alpha
21
+ Classifier: Intended Audience :: Developers
22
+ Classifier: Natural Language :: English
23
+ Classifier: Topic :: Software Development :: Libraries
24
+ Requires-Python: >=3.7
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: worktoy>=1.2.2
28
+ Dynamic: license-file
29
+
30
+ [![Tokens](https://img.shields.io/badge/Tokens-0-D97757)](https://claude.com/claude-code)
31
+
32
+ # cutienator v0.0.1-dev0 (development build)
33
+ A vastly superior binding of Qt C++ to Python.
@@ -0,0 +1,4 @@
1
+ [![Tokens](https://img.shields.io/badge/Tokens-0-D97757)](https://claude.com/claude-code)
2
+
3
+ # cutienator v0.0.1-dev0 (development build)
4
+ A vastly superior binding of Qt C++ to Python.
@@ -0,0 +1,60 @@
1
+ [build-system]
2
+ requires = ['setuptools>=77.0.0'] # PEP 639 licence metadata
3
+ build-backend = 'setuptools.build_meta'
4
+
5
+
6
+ [project]
7
+ name = "cutienator"
8
+ version = "0.0.1-dev0"
9
+ authors = [
10
+ { name = "Asger Jon Vistisen", email = "asgerjon2@gmail.com" },
11
+ ]
12
+ description = "A vastly superior binding of Qt C++ to Python"
13
+ readme = "README.md"
14
+ license = "Apache-2.0"
15
+ license-files = ["LICENSE"]
16
+ requires-python = ">=3.7"
17
+ dependencies = [
18
+ 'worktoy>=1.2.2',
19
+ ]
20
+ classifiers = [
21
+ 'Programming Language :: Python :: 3.7',
22
+ 'Programming Language :: Python :: 3.8',
23
+ 'Programming Language :: Python :: 3.9',
24
+ 'Programming Language :: Python :: 3.10',
25
+ 'Programming Language :: Python :: 3.11',
26
+ 'Programming Language :: Python :: 3.12',
27
+ 'Programming Language :: Python :: 3.13',
28
+ 'Programming Language :: Python :: 3.14',
29
+ 'Programming Language :: Python :: 3.15',
30
+ "Programming Language :: Python :: Implementation :: CPython",
31
+ "Operating System :: POSIX :: Linux",
32
+ "Development Status :: 2 - Pre-Alpha",
33
+ "Intended Audience :: Developers",
34
+ "Natural Language :: English",
35
+ "Topic :: Software Development :: Libraries"
36
+ ]
37
+
38
+ [project.urls]
39
+ "Homepage" = "https://github.com/AsgerJon/cutienator"
40
+ "Bug Tracker" = "https://github.com/AsgerJon/cutienator/issues"
41
+
42
+ [dependency-groups]
43
+ test = [
44
+ 'pytest>=9.0.2',
45
+ 'pytest-cov>=7.0.0',
46
+ ]
47
+
48
+ # The ritual files are C++ that 'cutienator.occult.Rituals' compiles on the
49
+ # machine the package is installed on, so they ship with the package.
50
+ [tool.setuptools.package-data]
51
+ cutienator = ["occult/rituals/*.cpp"]
52
+
53
+ # pytest configuration lives here rather than in a root 'pytest.ini' so
54
+ # the repository root stays uncluttered. pytest auto-discovers this
55
+ # table, so no '-c' flag is needed locally or in CI.
56
+ [tool.pytest.ini_options]
57
+ pythonpath = ["src"]
58
+ testpaths = ["tests"]
59
+ python_files = ["test_*.py"]
60
+ addopts = "--cov=cutienator --cov=tests --cov-branch --cov-report=term-missing"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,44 @@
1
+ """
2
+ The 'cutienator' provides Python bindings to the occult world of C++.
3
+ """
4
+ # Apache-2.0 license
5
+ # Copyright (c) 2026 Asger Jon Vistisen
6
+ from __future__ import annotations
7
+
8
+ __version__ = '0.0.1-dev0'
9
+
10
+ from ._cpp_addr import CppAddr
11
+ from ._cpp_box import CppBox
12
+ from ._wait import WAIT
13
+ from ._waiting_overload import WaitingOverload
14
+ from ._cute_overload import CuteOverload
15
+ from ._cute_load_hook import CuteLoadHook
16
+ from ._cute_space import CuteSpace
17
+ from ._meta_cute import MetaCute
18
+ from ._cute_mixin import CuteMixin
19
+ from ._ugly import Ugly
20
+ from ._q_meta_object import QMetaObject
21
+ from ._q_binding_storage import QBindingStorage
22
+ from ._q_event import QEvent
23
+ from ._q_object import QObject
24
+ from ._q_thread import QThread
25
+ from ._q_widget import QWidget
26
+
27
+ __all__ = (
28
+ 'CppAddr',
29
+ 'CppBox',
30
+ 'WAIT',
31
+ 'WaitingOverload',
32
+ 'CuteOverload',
33
+ 'CuteLoadHook',
34
+ 'CuteSpace',
35
+ 'MetaCute',
36
+ 'CuteMixin',
37
+ 'Ugly',
38
+ 'QMetaObject',
39
+ 'QBindingStorage',
40
+ 'QEvent',
41
+ 'QObject',
42
+ 'QThread',
43
+ 'QWidget',
44
+ )
@@ -0,0 +1,84 @@
1
+ """
2
+ CppAddr implements the descriptor protocol and finds the memory address of
3
+ the bound C++ object.
4
+ """
5
+ # Apache-2.0 license
6
+ # Copyright (c) 2026 Asger Jon Vistisen
7
+ from __future__ import annotations
8
+
9
+ from typing import TYPE_CHECKING, Generic, TypeVar
10
+
11
+ from worktoy.desc import BaseDescriptor
12
+
13
+ if TYPE_CHECKING: # pragma: no cover, no mutate
14
+ pass
15
+
16
+ T = TypeVar('T')
17
+
18
+
19
+ class CppAddr(BaseDescriptor, Generic[T]):
20
+ """
21
+ CppAddr implements the descriptor protocol and finds the memory address of
22
+ the bound C++ object.
23
+ """
24
+
25
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
26
+ # STATIC METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # # #
27
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
28
+
29
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
30
+ # NAMESPACE # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
31
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
32
+
33
+ # Class Variables
34
+
35
+ # Fallback Variables
36
+
37
+ # Private Variables
38
+
39
+ # Public Variables
40
+
41
+ # Virtual Variables
42
+
43
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
44
+ # GETTERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
45
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
46
+
47
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
48
+ # SETTERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
49
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
50
+
51
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
52
+ # NOTIFIERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
53
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
54
+
55
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
56
+ # Python API # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
57
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
58
+
59
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
60
+ # CONSTRUCTORS # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
61
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
62
+
63
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
64
+ # DOMAIN SPECIFIC # # # # # # # # # # # # # # # # # # # # # # # # # # # #
65
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
66
+
67
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
68
+ # OPTIONAL METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # #
69
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
70
+
71
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
72
+ # REQUIRED METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # #
73
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
74
+
75
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
76
+ # PARENT METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # # #
77
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
78
+
79
+ def __instance_get__(self, *args) -> int:
80
+ raise NotImplementedError
81
+
82
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
83
+ # PUBLIC METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # # #
84
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@@ -0,0 +1,23 @@
1
+ """
2
+ CppBox implements the descriptor protocol to lazily create the occult C++
3
+ object.
4
+ """
5
+ # Apache-2.0 license
6
+ # Copyright (c) 2026 Asger Jon Vistisen
7
+ from __future__ import annotations
8
+
9
+ from typing import TYPE_CHECKING, Generic, TypeVar
10
+
11
+ from worktoy.desc import AttriBox
12
+
13
+ if TYPE_CHECKING: # pragma: no cover, no mutate
14
+ pass
15
+
16
+ T = TypeVar('T')
17
+
18
+
19
+ class CppBox(AttriBox):
20
+ """
21
+ CppBox implements the descriptor protocol to lazily create the occult C++
22
+ object.
23
+ """
@@ -0,0 +1,159 @@
1
+ """
2
+ CuteLoadHook builds the overloaded method of a name again, after its
3
+ class is made.
4
+ """
5
+ # Apache-2.0 license
6
+ # Copyright (c) 2026 Asger Jon Vistisen
7
+ from __future__ import annotations
8
+
9
+ from typing import TYPE_CHECKING
10
+
11
+ from worktoy.mcls.space_hooks import LoadSpaceHook
12
+
13
+ if TYPE_CHECKING: # pragma: no cover, no mutate
14
+ from typing import Any, Optional
15
+
16
+ from worktoy.dispatch import Dispatcher
17
+
18
+
19
+ class CuteLoadHook(LoadSpaceHook):
20
+ """
21
+ Builds, for a class that exists already, the one object that stands at
22
+ an overloaded name and picks the function for each call. worktoy
23
+ calls that object a dispatcher. See 'WAIT' for the whole story; this
24
+ is the last part of step 6.
25
+
26
+ You never call it. 'MetaCute' does, when a late class is made:
27
+
28
+ space = QObject.getNamespace() # the 'CuteSpace' of QObject
29
+ dispatcher = space.cuteLoadHook.buildAgain('moveToThread')
30
+
31
+ Why it exists
32
+ -------------
33
+
34
+ worktoy builds the dispatcher of each overloaded name once, as the
35
+ class is made, from the signatures on record in the namespace of the
36
+ class and in the namespaces of the classes it is built on. A waiting
37
+ signature is not on record then. When its late class is made,
38
+ 'CuteSpace' puts it on record, and the dispatcher has to be built
39
+ once more from the full record, for the waiting class and for every
40
+ class built on it so far, since each class has a dispatcher of its
41
+ own.
42
+
43
+ The building itself is worktoy's, in 'LoadSpaceHook'. This class is
44
+ based on it only to reach that work from a class of our own.
45
+
46
+ What to expect
47
+ --------------
48
+
49
+ - It takes no part while a class body runs or is made into a class.
50
+ The hook 'loadSpaceHook' that 'CuteSpace' inherits from worktoy
51
+ does all of that, unchanged. The three phases this class would
52
+ otherwise run a second time do nothing here.
53
+ - 'buildAgain' reads the record as it is at that moment. It gives a
54
+ new dispatcher every time and puts it nowhere. 'MetaCute' places
55
+ it on the class.
56
+ - A dispatcher built again is the same as one built the first time
57
+ from the same record: signatures in the order they were written,
58
+ those of the class itself before those of the classes it is built
59
+ on.
60
+ """
61
+
62
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
63
+ # STATIC METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # # #
64
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
65
+
66
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
67
+ # NAMESPACE # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
68
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
69
+
70
+ # Class Variables
71
+
72
+ # Fallback Variables
73
+
74
+ # Private Variables
75
+
76
+ # Public Variables
77
+
78
+ # Virtual Variables
79
+
80
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
81
+ # GETTERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
82
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
83
+
84
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
85
+ # SETTERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
86
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
87
+
88
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
89
+ # NOTIFIERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
90
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
91
+
92
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
93
+ # Python API # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
94
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
95
+
96
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
97
+ # CONSTRUCTORS # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
98
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
99
+
100
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
101
+ # DOMAIN SPECIFIC # # # # # # # # # # # # # # # # # # # # # # # # # # # #
102
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
103
+
104
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
105
+ # OPTIONAL METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # #
106
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
107
+
108
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
109
+ # REQUIRED METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # #
110
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
111
+
112
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
113
+ # PARENT METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # # #
114
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
115
+
116
+ def setItemPhase(self, key: str, val: Any, old: Any = None, ) -> bool:
117
+ """
118
+ Does nothing, and claims nothing: 'loadSpaceHook' has already seen
119
+ the binding, and 'CuteSpace' has already taken any waiting
120
+ signature.
121
+ """
122
+ return False
123
+
124
+ def delItemPhase(self, key: str, val: Any = None, ) -> bool:
125
+ """Does nothing, and claims nothing: 'loadSpaceHook' has seen it."""
126
+ return False
127
+
128
+ def postCompilePhase(self, compiledSpace: dict) -> dict:
129
+ """
130
+ Changes nothing: 'loadSpaceHook' has just built every dispatcher of
131
+ the class, and building them a second time here would only replace
132
+ each with its like.
133
+ """
134
+ return compiledSpace
135
+
136
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
137
+ # PUBLIC METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # # #
138
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
139
+
140
+ def buildAgain(self, methodName: str) -> Optional[Dispatcher]:
141
+ """
142
+ Builds the dispatcher of one overloaded name from the record as it
143
+ is now, for the class of the namespace this hook was read through.
144
+
145
+ Parameters
146
+ ----------
147
+
148
+ methodName : str
149
+ The overloaded name, as 'moveToThread'.
150
+
151
+ Returns
152
+ -------
153
+
154
+ Optional[Dispatcher]
155
+ A new dispatcher holding every signature on record for the name,
156
+ of the class and of the classes it is built on. It is placed
157
+ nowhere yet. None when nothing is on record for the name.
158
+ """
159
+ return self._buildDispatcher(methodName)