worktoy 1.3.0.dev1__tar.gz → 1.3.0.dev2__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 (213) hide show
  1. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/PKG-INFO +138 -2
  2. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/README.md +137 -1
  3. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/pyproject.toml +1 -1
  4. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/__init__.py +1 -1
  5. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/_kee_num.py +71 -14
  6. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy.egg-info/PKG-INFO +138 -2
  7. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/LICENSE +0 -0
  8. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/setup.cfg +0 -0
  9. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/__init__.py +0 -0
  10. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/_instance_owner.py +0 -0
  11. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/_meta_type.py +0 -0
  12. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/_object.py +0 -0
  13. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/control_flow/__init__.py +0 -0
  14. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/control_flow/_control_flow.py +0 -0
  15. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/control_flow/_control_space.py +0 -0
  16. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/control_flow/_meta_flow.py +0 -0
  17. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/control_flow/_skip_set.py +0 -0
  18. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/sentinels/__init__.py +0 -0
  19. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/sentinels/_args.py +0 -0
  20. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/sentinels/_deleted.py +0 -0
  21. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/sentinels/_desc.py +0 -0
  22. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/sentinels/_meta_call.py +0 -0
  23. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/sentinels/_owner.py +0 -0
  24. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/sentinels/_sentinel.py +0 -0
  25. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/core/sentinels/_this.py +0 -0
  26. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/desc/__init__.py +0 -0
  27. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/desc/_alias.py +0 -0
  28. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/desc/_attri_box.py +0 -0
  29. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/desc/_base_descriptor.py +0 -0
  30. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/desc/_fast_box.py +0 -0
  31. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/desc/_field.py +0 -0
  32. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/desc/_fix_box.py +0 -0
  33. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/desc/_root_alias.py +0 -0
  34. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/desc/_symbolic_name.py +0 -0
  35. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/dispatch/__init__.py +0 -0
  36. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/dispatch/_abstract.py +0 -0
  37. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/dispatch/_call_me_maybe.py +0 -0
  38. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/dispatch/_dispatcher.py +0 -0
  39. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/dispatch/_flex_call.py +0 -0
  40. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/dispatch/_overload.py +0 -0
  41. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/dispatch/_permuter.py +0 -0
  42. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/dispatch/_permuter_method.py +0 -0
  43. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/dispatch/_type_sig.py +0 -0
  44. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/ezdata/__init__.py +0 -0
  45. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/ezdata/_ez_data.py +0 -0
  46. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/ezdata/_ez_field.py +0 -0
  47. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/ezdata/_ez_hook.py +0 -0
  48. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/ezdata/_ez_meta.py +0 -0
  49. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/ezdata/_ez_space.py +0 -0
  50. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/ezdata/_ez_store.py +0 -0
  51. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/ezdata/_fields.py +0 -0
  52. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/__init__.py +0 -0
  53. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/_access_num.py +0 -0
  54. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/_kee_box.py +0 -0
  55. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/_kee_flag.py +0 -0
  56. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/_kee_flags.py +0 -0
  57. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/_kee_flags_hook.py +0 -0
  58. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/_kee_flags_meta.py +0 -0
  59. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/_kee_flags_space.py +0 -0
  60. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/_kee_member.py +0 -0
  61. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/_kee_meta.py +0 -0
  62. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/_kee_meta_meta.py +0 -0
  63. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/_kee_space.py +0 -0
  64. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/keenum/_kee_space_hook.py +0 -0
  65. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/lorem_ipsum/__init__.py +0 -0
  66. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/lorem_ipsum/_base_generator.py +0 -0
  67. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/lorem_ipsum/_clause.py +0 -0
  68. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/lorem_ipsum/_gaussian_lengths.py +0 -0
  69. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/lorem_ipsum/_paragraph.py +0 -0
  70. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/lorem_ipsum/_sentence.py +0 -0
  71. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/lorem_ipsum/_stochastic_variable.py +0 -0
  72. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/lorem_ipsum/_stochastic_word.py +0 -0
  73. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/lorem_ipsum/_words.py +0 -0
  74. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/__init__.py +0 -0
  75. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/_abc_meta.py +0 -0
  76. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/_abc_object.py +0 -0
  77. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/_abc_space.py +0 -0
  78. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/_abstract_metaclass.py +0 -0
  79. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/_abstract_namespace.py +0 -0
  80. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/_base_meta.py +0 -0
  81. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/_base_object.py +0 -0
  82. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/_base_space.py +0 -0
  83. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/space_hooks/__init__.py +0 -0
  84. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/space_hooks/_abc_hook.py +0 -0
  85. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/space_hooks/_abstract_space_hook.py +0 -0
  86. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/space_hooks/_flex_call_hook.py +0 -0
  87. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/space_hooks/_load_space_hook.py +0 -0
  88. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/space_hooks/_name_hook.py +0 -0
  89. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/space_hooks/_reserved_names.py +0 -0
  90. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/space_hooks/_reserved_namespace_hook.py +0 -0
  91. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/mcls/space_hooks/_space_desc.py +0 -0
  92. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/py.typed +0 -0
  93. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/__init__.py +0 -0
  94. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_args_count.py +0 -0
  95. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_bipartite_matching.py +0 -0
  96. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_class_body_template.py +0 -0
  97. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_directory.py +0 -0
  98. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_exception_info.py +0 -0
  99. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_join_words.py +0 -0
  100. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_maybe.py +0 -0
  101. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_quick_desc.py +0 -0
  102. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_replace_flex.py +0 -0
  103. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_resolve_mro.py +0 -0
  104. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_slice_len.py +0 -0
  105. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_string_list.py +0 -0
  106. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_text_fmt.py +0 -0
  107. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_type_cast.py +0 -0
  108. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_unpack.py +0 -0
  109. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_valid_slice.py +0 -0
  110. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/_word_wrap.py +0 -0
  111. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/combinatorics/__init__.py +0 -0
  112. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/combinatorics/_arrangement.py +0 -0
  113. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/combinatorics/_arrangements.py +0 -0
  114. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/utilities/combinatorics/_index_permutations.py +0 -0
  115. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/__init__.py +0 -0
  116. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/_alternative_warning.py +0 -0
  117. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/_deprecated_promise.py +0 -0
  118. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/_missing_variable.py +0 -0
  119. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/_redundant_keyword.py +0 -0
  120. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/_risk_warning.py +0 -0
  121. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/_subclass_exception.py +0 -0
  122. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/_type_exception.py +0 -0
  123. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/_uncheckable_type.py +0 -0
  124. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/_unpack_exception.py +0 -0
  125. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/_variable_not_none.py +0 -0
  126. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/_work_toy_exception.py +0 -0
  127. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/_work_toy_warning.py +0 -0
  128. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/control_flow/__init__.py +0 -0
  129. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/__init__.py +0 -0
  130. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_access_error.py +0 -0
  131. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_dangling_alias.py +0 -0
  132. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_descriptor_exception.py +0 -0
  133. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_missing_instance_dict.py +0 -0
  134. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_nameless_callback.py +0 -0
  135. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_not_a_descriptor.py +0 -0
  136. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_overload_reference.py +0 -0
  137. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_phantom_box_error.py +0 -0
  138. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_protected_error.py +0 -0
  139. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_read_only_error.py +0 -0
  140. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_recursive_read.py +0 -0
  141. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_reference_conflict.py +0 -0
  142. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_shared_descriptor.py +0 -0
  143. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_without_exception.py +0 -0
  144. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/desc/_write_once_error.py +0 -0
  145. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/dispatch/__init__.py +0 -0
  146. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/dispatch/_bare_overload.py +0 -0
  147. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/dispatch/_dispatch_exception.py +0 -0
  148. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/dispatch/_duplicate_signature.py +0 -0
  149. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/dispatch/_type_cast_exception.py +0 -0
  150. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/dispatch/_unbound_cast_hook.py +0 -0
  151. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/ezdata/__init__.py +0 -0
  152. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/ezdata/_class_field_error.py +0 -0
  153. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/ezdata/_duplicate_error.py +0 -0
  154. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/ezdata/_extra_keyword_exception.py +0 -0
  155. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/ezdata/_extra_positional_exception.py +0 -0
  156. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/ezdata/_incomplete_field_exception.py +0 -0
  157. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/ezdata/_kw_only_exception.py +0 -0
  158. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/ezdata/_repeated_field_exception.py +0 -0
  159. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/ezdata/_reserved_attribute_error.py +0 -0
  160. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/ezdata/_reserved_field_error.py +0 -0
  161. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/ezdata/_reserved_method_error.py +0 -0
  162. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/keenum/__init__.py +0 -0
  163. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/keenum/_kee_box_exception.py +0 -0
  164. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/keenum/_kee_box_type_error.py +0 -0
  165. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/keenum/_kee_box_value_error.py +0 -0
  166. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/keenum/_kee_case_exception.py +0 -0
  167. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/keenum/_kee_duplicate.py +0 -0
  168. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/keenum/_kee_flag_duplicate.py +0 -0
  169. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/keenum/_kee_flag_name_error.py +0 -0
  170. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/keenum/_kee_member_name_error.py +0 -0
  171. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/keenum/_kee_name_conflict.py +0 -0
  172. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/keenum/_kee_resolve_error.py +0 -0
  173. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/keenum/_kee_type_exception.py +0 -0
  174. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/keenum/_kee_write_once_error.py +0 -0
  175. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/__init__.py +0 -0
  176. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_claimed_name.py +0 -0
  177. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_control_class_error.py +0 -0
  178. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_del_exception.py +0 -0
  179. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_duplicate_hook.py +0 -0
  180. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_duplicate_sentinel.py +0 -0
  181. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_hook_exception.py +0 -0
  182. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_illegal_instantiation.py +0 -0
  183. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_missing_implementation.py +0 -0
  184. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_mixed_method_kind.py +0 -0
  185. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_overload_conflict.py +0 -0
  186. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_questionable_syntax.py +0 -0
  187. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_rebound_overload.py +0 -0
  188. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_reserved_name.py +0 -0
  189. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_shadowed_class_hook.py +0 -0
  190. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_slots_refused.py +0 -0
  191. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_unbound_class_hook.py +0 -0
  192. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/waitaminute/meta/_wrong_implementation.py +0 -0
  193. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/__init__.py +0 -0
  194. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/_base_test.py +0 -0
  195. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/_complex_mixin.py +0 -0
  196. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/_complex_test.py +0 -0
  197. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/_sub_test.py +0 -0
  198. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/_test_meta.py +0 -0
  199. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/_test_space.py +0 -0
  200. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/samplers/__init__.py +0 -0
  201. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/samplers/_base_sampler.py +0 -0
  202. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/samplers/_float_sampler.py +0 -0
  203. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/samplers/_gaussian_sampler.py +0 -0
  204. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/samplers/_int_sampler.py +0 -0
  205. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/samplers/_lorem_sampler.py +0 -0
  206. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/samplers/_lorem_text.py +0 -0
  207. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/samplers/_sampler_meta.py +0 -0
  208. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/samplers/_symbolic_sampler.py +0 -0
  209. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy/work_test/samplers/_word_sampler.py +0 -0
  210. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy.egg-info/SOURCES.txt +0 -0
  211. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy.egg-info/dependency_links.txt +0 -0
  212. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/src/worktoy.egg-info/top_level.txt +0 -0
  213. {worktoy-1.3.0.dev1 → worktoy-1.3.0.dev2}/tests/test_smoke.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: worktoy
3
- Version: 1.3.0.dev1
3
+ Version: 1.3.0.dev2
4
4
  Summary: Declarative structure for Python that enforces types at runtime and enables true function overloading
5
5
  Author-email: Asger Jon Vistisen <asgerjon2@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -32,7 +32,7 @@ Dynamic: license-file
32
32
  [![PyPI version](https://img.shields.io/pypi/v/worktoy)](https://pypi.org/project/worktoy/)
33
33
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
34
34
 
35
- # worktoy v1.3.0-dev1 (development build)
35
+ # worktoy v1.3.0-dev2 (development build)
36
36
 
37
37
  **worktoy** provides utilities for Python development focused on
38
38
  reducing boilerplate while improving type safety and readability. Each
@@ -48,6 +48,7 @@ to 3.15.
48
48
  - ['Trust-Me-Bro'-Typing](#trust-me-bro-typing)
49
49
  - [The Python Parsing Situation Is Crazy](#the-python-parsing-situation-is-crazy)
50
50
  - ["Show Don't Tell" Is for Stories, not for Code!](#show-dont-tell-is-for-stories-not-for-code)
51
+ - [Abstract Classes That Check the Homework](#abstract-classes-that-check-the-homework)
51
52
  - [Static Discipline](#static-discipline)
52
53
  - [Contributing](#contributing)
53
54
  - [License](#license)
@@ -285,6 +286,141 @@ The `r` attribute is declared first. Next, the `@r.GET` declares that the
285
286
  method implementing the get operation comes next. The structure is
286
287
  visible separately from the behaviour.
287
288
 
289
+ ## Abstract Classes That Check the Homework
290
+
291
+ Python's `abc` lets a class leave methods for its subclasses to write:
292
+
293
+ ```python
294
+ from abc import ABC, abstractmethod
295
+
296
+
297
+ class Model(ABC):
298
+ @abstractmethod
299
+ def rowCount(self) -> int:
300
+ pass
301
+
302
+
303
+ class Names(Model):
304
+ def rowCount(self, parent) -> int: # one argument too many
305
+ return 3
306
+ ```
307
+
308
+ `abc` checks names, nothing else. `Names` has something called
309
+ `rowCount`, so `Names()` is created without a word, and the mistake waits
310
+ for the first call: `rowCount() missing 1 required positional argument`,
311
+ far from the class that made it. And `abc` has never heard of overloads,
312
+ so it cannot ask a subclass for one particular signature.
313
+
314
+ With **worktoy**, the base is `ABCObject` and the decorator is
315
+ `@abstract`:
316
+
317
+ ```python
318
+ from worktoy.mcls import ABCObject
319
+ from worktoy.dispatch import abstract
320
+
321
+
322
+ class Model(ABCObject):
323
+ @abstract
324
+ def rowCount(self) -> int: ...
325
+
326
+
327
+ class Names(Model): # WrongImplementation, right here
328
+ def rowCount(self, parent) -> int:
329
+ return 3
330
+ ```
331
+
332
+ What a subclass writes is held to what was declared, as the class is
333
+ created: the same kind of method, taking what the abstract one takes.
334
+ `Names` fails at its class statement with `WrongImplementation`. Until
335
+ every abstract method is written, making an object is refused with
336
+ `MissingImplementation`, naming what is left to write. A subclass may
337
+ write some of them, all or none, and may declare abstract methods of its
338
+ own.
339
+
340
+ A base class can also demand particular type signatures of an
341
+ overloaded name, two or more of them, and a subclass has to write every
342
+ one:
343
+
344
+ ```python
345
+ from worktoy.dispatch import overload
346
+
347
+
348
+ class Source(ABCObject):
349
+ @overload(str, int)
350
+ @abstract
351
+ def data(self, index: str, role: int) -> object: ...
352
+
353
+ @overload(bytes)
354
+ @abstract
355
+ def data(self, index: bytes) -> object: ...
356
+
357
+
358
+ class Text(Source):
359
+ @overload(str, int)
360
+ def data(self, index: str, role: int) -> object:
361
+ return index * role
362
+ ```
363
+
364
+ `Text` writes `data(str, int)` but not `data(bytes)`, so it is still
365
+ abstract: `Text()` is refused, and a subclass writing `data(bytes)`
366
+ completes it. One plain function at `data` taking `*args` would write
367
+ both signatures at once.
368
+
369
+ Where this pays off is a family of classes sharing one job. Take the
370
+ `Point` from above. Every transform must accept a `Point`, a pair of
371
+ floats or a complex number:
372
+
373
+ ```python
374
+ class Transform(ABCObject):
375
+ @overload(Point)
376
+ @abstract
377
+ def apply(self, point: Point) -> Point: ...
378
+
379
+ @overload(float, float)
380
+ @abstract
381
+ def apply(self, x: float, y: float) -> Point: ...
382
+
383
+ @abstract # above '@overload' or below it, either works
384
+ @overload(complex)
385
+ def apply(self, z: complex) -> Point: ...
386
+
387
+
388
+ class PointTransform(Transform):
389
+ @overload(float, float)
390
+ def apply(self, x: float, y: float) -> Point:
391
+ return self.apply(Point(x, y))
392
+
393
+ @overload(complex)
394
+ def apply(self, z: complex) -> Point:
395
+ return self.apply(Point(z))
396
+
397
+
398
+ class Shift(PointTransform):
399
+ dx = AttriBox[float](0.0)
400
+ dy = AttriBox[float](0.0)
401
+
402
+ @overload(Point)
403
+ def apply(self, point: Point) -> Point:
404
+ return Point(point.x + self.dx, point.y + self.dy)
405
+ ```
406
+
407
+ `Transform` demands three signatures. `PointTransform` writes two of
408
+ them in terms of the third, once and for all, and is still abstract:
409
+ `PointTransform()` is refused, since `apply(Point)` is not implemented.
410
+ A concrete transform then has a single thing left to say, how it moves
411
+ a `Point`, and gets the other two for free:
412
+
413
+ ```python
414
+ shift = Shift()
415
+ shift.dx, shift.dy = 1.0, 2.0
416
+ shift.apply(Point(0.0, 0.0)).y == 2.0
417
+ shift.apply(3.0, 4.0).x == 4.0
418
+ shift.apply(3 + 4j).y == 6.0
419
+ ```
420
+
421
+ `ABCObject` is `BaseObject` built by worktoy's own `ABCMeta`, which is no
422
+ relative of the one in `abc`.
423
+
288
424
  ## Static Discipline
289
425
 
290
426
  In plain Python, attributes assigned in `__init__` are closer to
@@ -4,7 +4,7 @@
4
4
  [![PyPI version](https://img.shields.io/pypi/v/worktoy)](https://pypi.org/project/worktoy/)
5
5
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
6
 
7
- # worktoy v1.3.0-dev1 (development build)
7
+ # worktoy v1.3.0-dev2 (development build)
8
8
 
9
9
  **worktoy** provides utilities for Python development focused on
10
10
  reducing boilerplate while improving type safety and readability. Each
@@ -20,6 +20,7 @@ to 3.15.
20
20
  - ['Trust-Me-Bro'-Typing](#trust-me-bro-typing)
21
21
  - [The Python Parsing Situation Is Crazy](#the-python-parsing-situation-is-crazy)
22
22
  - ["Show Don't Tell" Is for Stories, not for Code!](#show-dont-tell-is-for-stories-not-for-code)
23
+ - [Abstract Classes That Check the Homework](#abstract-classes-that-check-the-homework)
23
24
  - [Static Discipline](#static-discipline)
24
25
  - [Contributing](#contributing)
25
26
  - [License](#license)
@@ -257,6 +258,141 @@ The `r` attribute is declared first. Next, the `@r.GET` declares that the
257
258
  method implementing the get operation comes next. The structure is
258
259
  visible separately from the behaviour.
259
260
 
261
+ ## Abstract Classes That Check the Homework
262
+
263
+ Python's `abc` lets a class leave methods for its subclasses to write:
264
+
265
+ ```python
266
+ from abc import ABC, abstractmethod
267
+
268
+
269
+ class Model(ABC):
270
+ @abstractmethod
271
+ def rowCount(self) -> int:
272
+ pass
273
+
274
+
275
+ class Names(Model):
276
+ def rowCount(self, parent) -> int: # one argument too many
277
+ return 3
278
+ ```
279
+
280
+ `abc` checks names, nothing else. `Names` has something called
281
+ `rowCount`, so `Names()` is created without a word, and the mistake waits
282
+ for the first call: `rowCount() missing 1 required positional argument`,
283
+ far from the class that made it. And `abc` has never heard of overloads,
284
+ so it cannot ask a subclass for one particular signature.
285
+
286
+ With **worktoy**, the base is `ABCObject` and the decorator is
287
+ `@abstract`:
288
+
289
+ ```python
290
+ from worktoy.mcls import ABCObject
291
+ from worktoy.dispatch import abstract
292
+
293
+
294
+ class Model(ABCObject):
295
+ @abstract
296
+ def rowCount(self) -> int: ...
297
+
298
+
299
+ class Names(Model): # WrongImplementation, right here
300
+ def rowCount(self, parent) -> int:
301
+ return 3
302
+ ```
303
+
304
+ What a subclass writes is held to what was declared, as the class is
305
+ created: the same kind of method, taking what the abstract one takes.
306
+ `Names` fails at its class statement with `WrongImplementation`. Until
307
+ every abstract method is written, making an object is refused with
308
+ `MissingImplementation`, naming what is left to write. A subclass may
309
+ write some of them, all or none, and may declare abstract methods of its
310
+ own.
311
+
312
+ A base class can also demand particular type signatures of an
313
+ overloaded name, two or more of them, and a subclass has to write every
314
+ one:
315
+
316
+ ```python
317
+ from worktoy.dispatch import overload
318
+
319
+
320
+ class Source(ABCObject):
321
+ @overload(str, int)
322
+ @abstract
323
+ def data(self, index: str, role: int) -> object: ...
324
+
325
+ @overload(bytes)
326
+ @abstract
327
+ def data(self, index: bytes) -> object: ...
328
+
329
+
330
+ class Text(Source):
331
+ @overload(str, int)
332
+ def data(self, index: str, role: int) -> object:
333
+ return index * role
334
+ ```
335
+
336
+ `Text` writes `data(str, int)` but not `data(bytes)`, so it is still
337
+ abstract: `Text()` is refused, and a subclass writing `data(bytes)`
338
+ completes it. One plain function at `data` taking `*args` would write
339
+ both signatures at once.
340
+
341
+ Where this pays off is a family of classes sharing one job. Take the
342
+ `Point` from above. Every transform must accept a `Point`, a pair of
343
+ floats or a complex number:
344
+
345
+ ```python
346
+ class Transform(ABCObject):
347
+ @overload(Point)
348
+ @abstract
349
+ def apply(self, point: Point) -> Point: ...
350
+
351
+ @overload(float, float)
352
+ @abstract
353
+ def apply(self, x: float, y: float) -> Point: ...
354
+
355
+ @abstract # above '@overload' or below it, either works
356
+ @overload(complex)
357
+ def apply(self, z: complex) -> Point: ...
358
+
359
+
360
+ class PointTransform(Transform):
361
+ @overload(float, float)
362
+ def apply(self, x: float, y: float) -> Point:
363
+ return self.apply(Point(x, y))
364
+
365
+ @overload(complex)
366
+ def apply(self, z: complex) -> Point:
367
+ return self.apply(Point(z))
368
+
369
+
370
+ class Shift(PointTransform):
371
+ dx = AttriBox[float](0.0)
372
+ dy = AttriBox[float](0.0)
373
+
374
+ @overload(Point)
375
+ def apply(self, point: Point) -> Point:
376
+ return Point(point.x + self.dx, point.y + self.dy)
377
+ ```
378
+
379
+ `Transform` demands three signatures. `PointTransform` writes two of
380
+ them in terms of the third, once and for all, and is still abstract:
381
+ `PointTransform()` is refused, since `apply(Point)` is not implemented.
382
+ A concrete transform then has a single thing left to say, how it moves
383
+ a `Point`, and gets the other two for free:
384
+
385
+ ```python
386
+ shift = Shift()
387
+ shift.dx, shift.dy = 1.0, 2.0
388
+ shift.apply(Point(0.0, 0.0)).y == 2.0
389
+ shift.apply(3.0, 4.0).x == 4.0
390
+ shift.apply(3 + 4j).y == 6.0
391
+ ```
392
+
393
+ `ABCObject` is `BaseObject` built by worktoy's own `ABCMeta`, which is no
394
+ relative of the one in `abc`.
395
+
260
396
  ## Static Discipline
261
397
 
262
398
  In plain Python, attributes assigned in `__init__` are closer to
@@ -5,7 +5,7 @@ build-backend = 'setuptools.build_meta'
5
5
 
6
6
  [project]
7
7
  name = "worktoy"
8
- version = "1.3.0-dev1"
8
+ version = "1.3.0-dev2"
9
9
  authors = [
10
10
  { name = "Asger Jon Vistisen", email = "asgerjon2@gmail.com" },
11
11
  ]
@@ -48,7 +48,7 @@ and the enclosing class is left without the decoration.
48
48
  # Copyright (c) 2025-2026 Asger Jon Vistisen
49
49
  from __future__ import annotations
50
50
 
51
- __version__ = '1.3.0-dev1'
51
+ __version__ = '1.3.0-dev2'
52
52
 
53
53
  from . import utilities
54
54
  from . import waitaminute
@@ -8,8 +8,9 @@ from __future__ import annotations
8
8
  from typing import TYPE_CHECKING, overload
9
9
 
10
10
  from ..core import MetaType
11
- from ..utilities import textFmt
11
+ from ..utilities import textFmt, typeCast
12
12
  from ..waitaminute import DeprecatedPromise
13
+ from ..waitaminute.dispatch import TypeCastException
13
14
  from ..waitaminute.keenum import KeeResolveError, KeeWriteOnceError
14
15
  from . import Kee
15
16
 
@@ -77,9 +78,10 @@ class KeeBase(metaclass=MetaType):
77
78
 
78
79
  index : int
79
80
  Deprecated: the position of the member among those of the class that
80
- declared it. Reading it, 'int(member)' and using the member as an
81
- index give a 'DeprecatedPromise', since the position belongs to the
82
- enumeration: 'Day[x]' gives the member at a position.
81
+ declared it. Reading it gives a 'DeprecatedPromise', since the
82
+ position belongs to the enumeration: 'Day[x]' gives the member at a
83
+ position. 'int(member)', and the member used as an index, go by the
84
+ value and not by the position; see '__int__' and '__index__'.
83
85
 
84
86
  value : Any
85
87
  The value the 'Kee' built.
@@ -218,21 +220,76 @@ class KeeBase(metaclass=MetaType):
218
220
 
219
221
  def __int__(self) -> int:
220
222
  """
221
- 'int(member)' gives the deprecated position, with a
222
- 'DeprecatedPromise'; see '_readIndex'.
223
+ A member stands for its value, so 'int(member)' must give the value
224
+ as an integer wherever the value is a whole number, as
225
+ 'int(Size.LARGE)' gives 3 for a member holding 3. Where the member
226
+ stands in its class plays no part. A value that is no whole number
227
+ has no integer to give, and the conversion must then fail as Python
228
+ fails 'int' of an object that is no number, without truncating a
229
+ fraction or parsing a text on the way.
230
+
231
+ Implementation
232
+ --------------
233
+
234
+ 'typeCast' decides, as for every conversion in the library: an
235
+ 'int', a whole 'float' and a real, whole 'complex' convert, and
236
+ nothing else does. Its refusal is raised again as a 'TypeError'
237
+ naming the member. The result is made a plain 'int', which Python
238
+ asks of '__int__'.
239
+
240
+ Returns
241
+ -------
242
+
243
+ int
244
+ The value of the member as an integer.
245
+
246
+ Raises
247
+ ------
248
+
249
+ TypeError
250
+ The value is no whole number.
223
251
  """
224
- info = textFmt(_POSITION)
225
- DeprecatedPromise('worktoy.keenum.KeeBase.__int__', info).warn()
226
- return self.__member_index__
252
+ try:
253
+ return int(typeCast(int, self.value))
254
+ except TypeCastException as typeCastException:
255
+ infoSpec = """Enumeration member '%s' converts to no 'int': its
256
+ value of type '%s' is no whole number!"""
257
+ info = infoSpec % (self, type(self.value).__name__)
258
+ raise TypeError(textFmt(info)) from typeCastException
227
259
 
228
260
  def __index__(self) -> int:
229
261
  """
230
- A member used as an index, as in 'items[member]', gives the
231
- deprecated position, with a 'DeprecatedPromise'; see '_readIndex'.
262
+ A member whose value is an integer must serve wherever Python takes
263
+ an integer without loss, as an index in 'items[member]' or a count
264
+ in 'range(member)', by that value. Python asks more of an index
265
+ than of 'int': a whole 'float' converts with 'int' and is still no
266
+ index, and the same must hold for a member holding one.
267
+
268
+ Implementation
269
+ --------------
270
+
271
+ A value that is an 'int' is returned as a plain 'int', which Python
272
+ asks of '__index__'; any other value raises 'TypeError'.
273
+
274
+ Returns
275
+ -------
276
+
277
+ int
278
+ The value of the member.
279
+
280
+ Raises
281
+ ------
282
+
283
+ TypeError
284
+ The value is no 'int'.
232
285
  """
233
- info = textFmt(_POSITION)
234
- DeprecatedPromise('worktoy.keenum.KeeBase.__index__', info).warn()
235
- return self.__member_index__
286
+ value = self.value
287
+ if isinstance(value, int):
288
+ return int(value)
289
+ infoSpec = """Enumeration member '%s' serves as no index: its value
290
+ of type '%s' is no 'int'!"""
291
+ info = infoSpec % (self, type(value).__name__)
292
+ raise TypeError(textFmt(info))
236
293
 
237
294
  def __hash__(self) -> int:
238
295
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: worktoy
3
- Version: 1.3.0.dev1
3
+ Version: 1.3.0.dev2
4
4
  Summary: Declarative structure for Python that enforces types at runtime and enables true function overloading
5
5
  Author-email: Asger Jon Vistisen <asgerjon2@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -32,7 +32,7 @@ Dynamic: license-file
32
32
  [![PyPI version](https://img.shields.io/pypi/v/worktoy)](https://pypi.org/project/worktoy/)
33
33
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
34
34
 
35
- # worktoy v1.3.0-dev1 (development build)
35
+ # worktoy v1.3.0-dev2 (development build)
36
36
 
37
37
  **worktoy** provides utilities for Python development focused on
38
38
  reducing boilerplate while improving type safety and readability. Each
@@ -48,6 +48,7 @@ to 3.15.
48
48
  - ['Trust-Me-Bro'-Typing](#trust-me-bro-typing)
49
49
  - [The Python Parsing Situation Is Crazy](#the-python-parsing-situation-is-crazy)
50
50
  - ["Show Don't Tell" Is for Stories, not for Code!](#show-dont-tell-is-for-stories-not-for-code)
51
+ - [Abstract Classes That Check the Homework](#abstract-classes-that-check-the-homework)
51
52
  - [Static Discipline](#static-discipline)
52
53
  - [Contributing](#contributing)
53
54
  - [License](#license)
@@ -285,6 +286,141 @@ The `r` attribute is declared first. Next, the `@r.GET` declares that the
285
286
  method implementing the get operation comes next. The structure is
286
287
  visible separately from the behaviour.
287
288
 
289
+ ## Abstract Classes That Check the Homework
290
+
291
+ Python's `abc` lets a class leave methods for its subclasses to write:
292
+
293
+ ```python
294
+ from abc import ABC, abstractmethod
295
+
296
+
297
+ class Model(ABC):
298
+ @abstractmethod
299
+ def rowCount(self) -> int:
300
+ pass
301
+
302
+
303
+ class Names(Model):
304
+ def rowCount(self, parent) -> int: # one argument too many
305
+ return 3
306
+ ```
307
+
308
+ `abc` checks names, nothing else. `Names` has something called
309
+ `rowCount`, so `Names()` is created without a word, and the mistake waits
310
+ for the first call: `rowCount() missing 1 required positional argument`,
311
+ far from the class that made it. And `abc` has never heard of overloads,
312
+ so it cannot ask a subclass for one particular signature.
313
+
314
+ With **worktoy**, the base is `ABCObject` and the decorator is
315
+ `@abstract`:
316
+
317
+ ```python
318
+ from worktoy.mcls import ABCObject
319
+ from worktoy.dispatch import abstract
320
+
321
+
322
+ class Model(ABCObject):
323
+ @abstract
324
+ def rowCount(self) -> int: ...
325
+
326
+
327
+ class Names(Model): # WrongImplementation, right here
328
+ def rowCount(self, parent) -> int:
329
+ return 3
330
+ ```
331
+
332
+ What a subclass writes is held to what was declared, as the class is
333
+ created: the same kind of method, taking what the abstract one takes.
334
+ `Names` fails at its class statement with `WrongImplementation`. Until
335
+ every abstract method is written, making an object is refused with
336
+ `MissingImplementation`, naming what is left to write. A subclass may
337
+ write some of them, all or none, and may declare abstract methods of its
338
+ own.
339
+
340
+ A base class can also demand particular type signatures of an
341
+ overloaded name, two or more of them, and a subclass has to write every
342
+ one:
343
+
344
+ ```python
345
+ from worktoy.dispatch import overload
346
+
347
+
348
+ class Source(ABCObject):
349
+ @overload(str, int)
350
+ @abstract
351
+ def data(self, index: str, role: int) -> object: ...
352
+
353
+ @overload(bytes)
354
+ @abstract
355
+ def data(self, index: bytes) -> object: ...
356
+
357
+
358
+ class Text(Source):
359
+ @overload(str, int)
360
+ def data(self, index: str, role: int) -> object:
361
+ return index * role
362
+ ```
363
+
364
+ `Text` writes `data(str, int)` but not `data(bytes)`, so it is still
365
+ abstract: `Text()` is refused, and a subclass writing `data(bytes)`
366
+ completes it. One plain function at `data` taking `*args` would write
367
+ both signatures at once.
368
+
369
+ Where this pays off is a family of classes sharing one job. Take the
370
+ `Point` from above. Every transform must accept a `Point`, a pair of
371
+ floats or a complex number:
372
+
373
+ ```python
374
+ class Transform(ABCObject):
375
+ @overload(Point)
376
+ @abstract
377
+ def apply(self, point: Point) -> Point: ...
378
+
379
+ @overload(float, float)
380
+ @abstract
381
+ def apply(self, x: float, y: float) -> Point: ...
382
+
383
+ @abstract # above '@overload' or below it, either works
384
+ @overload(complex)
385
+ def apply(self, z: complex) -> Point: ...
386
+
387
+
388
+ class PointTransform(Transform):
389
+ @overload(float, float)
390
+ def apply(self, x: float, y: float) -> Point:
391
+ return self.apply(Point(x, y))
392
+
393
+ @overload(complex)
394
+ def apply(self, z: complex) -> Point:
395
+ return self.apply(Point(z))
396
+
397
+
398
+ class Shift(PointTransform):
399
+ dx = AttriBox[float](0.0)
400
+ dy = AttriBox[float](0.0)
401
+
402
+ @overload(Point)
403
+ def apply(self, point: Point) -> Point:
404
+ return Point(point.x + self.dx, point.y + self.dy)
405
+ ```
406
+
407
+ `Transform` demands three signatures. `PointTransform` writes two of
408
+ them in terms of the third, once and for all, and is still abstract:
409
+ `PointTransform()` is refused, since `apply(Point)` is not implemented.
410
+ A concrete transform then has a single thing left to say, how it moves
411
+ a `Point`, and gets the other two for free:
412
+
413
+ ```python
414
+ shift = Shift()
415
+ shift.dx, shift.dy = 1.0, 2.0
416
+ shift.apply(Point(0.0, 0.0)).y == 2.0
417
+ shift.apply(3.0, 4.0).x == 4.0
418
+ shift.apply(3 + 4j).y == 6.0
419
+ ```
420
+
421
+ `ABCObject` is `BaseObject` built by worktoy's own `ABCMeta`, which is no
422
+ relative of the one in `abc`.
423
+
288
424
  ## Static Discipline
289
425
 
290
426
  In plain Python, attributes assigned in `__init__` are closer to
File without changes
File without changes