worktoy 1.2.1rc0__tar.gz → 1.2.2.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 (208) hide show
  1. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/PKG-INFO +2 -2
  2. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/README.md +1 -1
  3. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/pyproject.toml +1 -1
  4. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/__init__.py +1 -1
  5. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/keenum/_kee_member.py +9 -8
  6. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/keenum/_kee_meta.py +7 -6
  7. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/keenum/_kee_space.py +59 -12
  8. worktoy-1.2.2.dev0/src/worktoy/keenum/_kee_space_hook.py +219 -0
  9. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/keenum/_kee_case_exception.py +3 -1
  10. worktoy-1.2.2.dev0/src/worktoy/waitaminute/keenum/_kee_duplicate.py +65 -0
  11. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_reserved_name.py +5 -2
  12. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy.egg-info/PKG-INFO +2 -2
  13. worktoy-1.2.1rc0/src/worktoy/keenum/_kee_space_hook.py +0 -57
  14. worktoy-1.2.1rc0/src/worktoy/waitaminute/keenum/_kee_duplicate.py +0 -52
  15. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/LICENSE +0 -0
  16. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/setup.cfg +0 -0
  17. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/__init__.py +0 -0
  18. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/_instance_owner.py +0 -0
  19. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/_meta_type.py +0 -0
  20. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/_object.py +0 -0
  21. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/control_flow/__init__.py +0 -0
  22. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/control_flow/_control_flow.py +0 -0
  23. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/control_flow/_control_space.py +0 -0
  24. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/control_flow/_meta_flow.py +0 -0
  25. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/control_flow/_skip_set.py +0 -0
  26. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/sentinels/__init__.py +0 -0
  27. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/sentinels/_args.py +0 -0
  28. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/sentinels/_deleted.py +0 -0
  29. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/sentinels/_desc.py +0 -0
  30. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/sentinels/_meta_call.py +0 -0
  31. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/sentinels/_owner.py +0 -0
  32. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/sentinels/_sentinel.py +0 -0
  33. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/core/sentinels/_this.py +0 -0
  34. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/desc/__init__.py +0 -0
  35. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/desc/_alias.py +0 -0
  36. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/desc/_attri_box.py +0 -0
  37. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/desc/_base_descriptor.py +0 -0
  38. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/desc/_fast_box.py +0 -0
  39. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/desc/_field.py +0 -0
  40. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/desc/_fix_box.py +0 -0
  41. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/desc/_root_alias.py +0 -0
  42. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/desc/_symbolic_name.py +0 -0
  43. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/dispatch/__init__.py +0 -0
  44. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/dispatch/_call_me_maybe.py +0 -0
  45. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/dispatch/_dispatcher.py +0 -0
  46. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/dispatch/_flex_call.py +0 -0
  47. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/dispatch/_overload.py +0 -0
  48. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/dispatch/_permuter.py +0 -0
  49. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/dispatch/_permuter_method.py +0 -0
  50. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/dispatch/_type_sig.py +0 -0
  51. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/ezdata/__init__.py +0 -0
  52. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/ezdata/_ez_data.py +0 -0
  53. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/ezdata/_ez_field.py +0 -0
  54. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/ezdata/_ez_hook.py +0 -0
  55. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/ezdata/_ez_meta.py +0 -0
  56. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/ezdata/_ez_space.py +0 -0
  57. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/ezdata/_ez_store.py +0 -0
  58. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/ezdata/_fields.py +0 -0
  59. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/keenum/__init__.py +0 -0
  60. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/keenum/_access_num.py +0 -0
  61. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/keenum/_kee_box.py +0 -0
  62. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/keenum/_kee_flag.py +0 -0
  63. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/keenum/_kee_flags.py +0 -0
  64. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/keenum/_kee_flags_hook.py +0 -0
  65. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/keenum/_kee_flags_meta.py +0 -0
  66. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/keenum/_kee_flags_space.py +0 -0
  67. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/keenum/_kee_meta_meta.py +0 -0
  68. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/keenum/_kee_num.py +0 -0
  69. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/lorem_ipsum/__init__.py +0 -0
  70. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/lorem_ipsum/_base_generator.py +0 -0
  71. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/lorem_ipsum/_clause.py +0 -0
  72. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/lorem_ipsum/_gaussian_lengths.py +0 -0
  73. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/lorem_ipsum/_paragraph.py +0 -0
  74. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/lorem_ipsum/_sentence.py +0 -0
  75. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/lorem_ipsum/_stochastic_variable.py +0 -0
  76. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/lorem_ipsum/_stochastic_word.py +0 -0
  77. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/lorem_ipsum/_words.py +0 -0
  78. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/__init__.py +0 -0
  79. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/_abstract_metaclass.py +0 -0
  80. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/_abstract_namespace.py +0 -0
  81. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/_base_meta.py +0 -0
  82. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/_base_object.py +0 -0
  83. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/_base_space.py +0 -0
  84. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/space_hooks/__init__.py +0 -0
  85. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/space_hooks/_abstract_space_hook.py +0 -0
  86. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/space_hooks/_flex_call_hook.py +0 -0
  87. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/space_hooks/_load_space_hook.py +0 -0
  88. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/space_hooks/_name_hook.py +0 -0
  89. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/space_hooks/_reserved_names.py +0 -0
  90. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/space_hooks/_reserved_namespace_hook.py +0 -0
  91. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/mcls/space_hooks/_space_desc.py +0 -0
  92. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/py.typed +0 -0
  93. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/__init__.py +0 -0
  94. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_args_count.py +0 -0
  95. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_bipartite_matching.py +0 -0
  96. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_class_body_template.py +0 -0
  97. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_directory.py +0 -0
  98. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_exception_info.py +0 -0
  99. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_join_words.py +0 -0
  100. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_maybe.py +0 -0
  101. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_quick_desc.py +0 -0
  102. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_replace_flex.py +0 -0
  103. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_resolve_mro.py +0 -0
  104. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_slice_len.py +0 -0
  105. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_string_list.py +0 -0
  106. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_text_fmt.py +0 -0
  107. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_type_cast.py +0 -0
  108. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_unpack.py +0 -0
  109. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_valid_slice.py +0 -0
  110. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/_word_wrap.py +0 -0
  111. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/combinatorics/__init__.py +0 -0
  112. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/combinatorics/_arrangement.py +0 -0
  113. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/combinatorics/_arrangements.py +0 -0
  114. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/utilities/combinatorics/_index_permutations.py +0 -0
  115. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/__init__.py +0 -0
  116. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/_alternative_warning.py +0 -0
  117. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/_deprecated_promise.py +0 -0
  118. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/_missing_variable.py +0 -0
  119. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/_redundant_keyword.py +0 -0
  120. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/_risk_warning.py +0 -0
  121. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/_subclass_exception.py +0 -0
  122. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/_type_exception.py +0 -0
  123. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/_uncheckable_type.py +0 -0
  124. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/_unpack_exception.py +0 -0
  125. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/_variable_not_none.py +0 -0
  126. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/_work_toy_exception.py +0 -0
  127. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/_work_toy_warning.py +0 -0
  128. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/control_flow/__init__.py +0 -0
  129. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/__init__.py +0 -0
  130. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_access_error.py +0 -0
  131. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_dangling_alias.py +0 -0
  132. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_descriptor_exception.py +0 -0
  133. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_missing_instance_dict.py +0 -0
  134. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_nameless_callback.py +0 -0
  135. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_not_a_descriptor.py +0 -0
  136. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_overload_reference.py +0 -0
  137. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_phantom_box_error.py +0 -0
  138. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_protected_error.py +0 -0
  139. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_read_only_error.py +0 -0
  140. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_recursive_read.py +0 -0
  141. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_reference_conflict.py +0 -0
  142. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_shared_descriptor.py +0 -0
  143. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_without_exception.py +0 -0
  144. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/desc/_write_once_error.py +0 -0
  145. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/dispatch/__init__.py +0 -0
  146. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/dispatch/_bare_overload.py +0 -0
  147. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/dispatch/_dispatch_exception.py +0 -0
  148. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/dispatch/_duplicate_signature.py +0 -0
  149. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/dispatch/_type_cast_exception.py +0 -0
  150. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/dispatch/_unbound_cast_hook.py +0 -0
  151. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/ezdata/__init__.py +0 -0
  152. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/ezdata/_class_field_error.py +0 -0
  153. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/ezdata/_duplicate_error.py +0 -0
  154. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/ezdata/_extra_keyword_exception.py +0 -0
  155. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/ezdata/_extra_positional_exception.py +0 -0
  156. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/ezdata/_incomplete_field_exception.py +0 -0
  157. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/ezdata/_kw_only_exception.py +0 -0
  158. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/ezdata/_repeated_field_exception.py +0 -0
  159. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/ezdata/_reserved_attribute_error.py +0 -0
  160. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/ezdata/_reserved_field_error.py +0 -0
  161. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/ezdata/_reserved_method_error.py +0 -0
  162. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/keenum/__init__.py +0 -0
  163. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/keenum/_kee_box_exception.py +0 -0
  164. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/keenum/_kee_box_type_error.py +0 -0
  165. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/keenum/_kee_box_value_error.py +0 -0
  166. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/keenum/_kee_flag_duplicate.py +0 -0
  167. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/keenum/_kee_flag_name_error.py +0 -0
  168. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/keenum/_kee_member_name_error.py +0 -0
  169. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/keenum/_kee_name_conflict.py +0 -0
  170. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/keenum/_kee_resolve_error.py +0 -0
  171. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/keenum/_kee_type_exception.py +0 -0
  172. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/keenum/_kee_write_once_error.py +0 -0
  173. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/__init__.py +0 -0
  174. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_claimed_name.py +0 -0
  175. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_control_class_error.py +0 -0
  176. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_del_exception.py +0 -0
  177. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_duplicate_hook.py +0 -0
  178. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_duplicate_sentinel.py +0 -0
  179. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_hook_exception.py +0 -0
  180. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_illegal_instantiation.py +0 -0
  181. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_mixed_method_kind.py +0 -0
  182. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_overload_conflict.py +0 -0
  183. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_questionable_syntax.py +0 -0
  184. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_rebound_overload.py +0 -0
  185. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_shadowed_class_hook.py +0 -0
  186. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_slots_refused.py +0 -0
  187. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/waitaminute/meta/_unbound_class_hook.py +0 -0
  188. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/__init__.py +0 -0
  189. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/_base_test.py +0 -0
  190. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/_complex_mixin.py +0 -0
  191. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/_complex_test.py +0 -0
  192. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/_sub_test.py +0 -0
  193. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/_test_meta.py +0 -0
  194. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/_test_space.py +0 -0
  195. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/samplers/__init__.py +0 -0
  196. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/samplers/_base_sampler.py +0 -0
  197. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/samplers/_float_sampler.py +0 -0
  198. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/samplers/_gaussian_sampler.py +0 -0
  199. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/samplers/_int_sampler.py +0 -0
  200. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/samplers/_lorem_sampler.py +0 -0
  201. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/samplers/_lorem_text.py +0 -0
  202. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/samplers/_sampler_meta.py +0 -0
  203. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/samplers/_symbolic_sampler.py +0 -0
  204. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy/work_test/samplers/_word_sampler.py +0 -0
  205. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy.egg-info/SOURCES.txt +0 -0
  206. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy.egg-info/dependency_links.txt +0 -0
  207. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/src/worktoy.egg-info/top_level.txt +0 -0
  208. {worktoy-1.2.1rc0 → worktoy-1.2.2.dev0}/tests/test_smoke.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: worktoy
3
- Version: 1.2.1rc0
3
+ Version: 1.2.2.dev0
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.2.1-rc0 (release candidate)
35
+ # worktoy v1.2.2-dev0 (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
@@ -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.2.1-rc0 (release candidate)
7
+ # worktoy v1.2.2-dev0 (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
@@ -5,7 +5,7 @@ build-backend = 'setuptools.build_meta'
5
5
 
6
6
  [project]
7
7
  name = "worktoy"
8
- version = "1.2.1-rc0"
8
+ version = "1.2.2-dev0"
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.2.1-rc0'
51
+ __version__ = '1.2.2-dev0'
52
52
 
53
53
  from . import utilities
54
54
  from . import waitaminute
@@ -12,7 +12,6 @@ from ..desc import Field, AttriBox
12
12
  from ..utilities import textFmt
13
13
  from ..waitaminute import VariableNotNone, MissingVariable, TypeException
14
14
  from ..waitaminute import DeprecatedPromise
15
- from ..waitaminute.keenum import KeeCaseException
16
15
 
17
16
  if TYPE_CHECKING: # pragma: no cover, no mutate
18
17
  from typing import Any, Self
@@ -34,11 +33,15 @@ class Kee(AttriBox[T]):
34
33
 
35
34
  - name: The name of the member, taken from the class-body
36
35
  assignment by 'KeeSpace.addNum'. Names must be unique within an
37
- enumeration and must be uppercase. The uppercase rule is
38
- enforced: assigning a 'Kee' to a non-uppercase name (lowercase or
39
- mixed case) raises 'KeeCaseException' when the class is created. A
40
- non-'Kee' class-body entry is unaffected and stays an ordinary
41
- class attribute.
36
+ enumeration, differing by more than their case, and must be
37
+ uppercase. The uppercase rule is
38
+ enforced by 'KeeSpaceHook': binding a 'Kee' to a non-uppercase
39
+ name (lowercase or mixed case) raises 'KeeCaseException' at that
40
+ line of the class body, unless the class statement, or that of a
41
+ class it is based on, says 'strictCase=False'; the name may then
42
+ not be one a base or the metaclass holds already, as 'members' or
43
+ 'space', which raises 'ReservedName'. A non-'Kee' class-body entry
44
+ is unaffected and stays an ordinary class attribute.
42
45
  - value: The value of the member. Values are not required to be
43
46
  unique across members of the same enumeration.
44
47
  - index: Deprecated. The position of the member, equal to the number
@@ -150,8 +153,6 @@ class Kee(AttriBox[T]):
150
153
 
151
154
  @name.SET
152
155
  def _setName(self, name: str) -> None:
153
- if not name.isupper():
154
- raise KeeCaseException(name)
155
156
  if self.__num_name__ is not None:
156
157
  raise VariableNotNone('name', self.__num_name__)
157
158
  self.__num_name__ = name
@@ -208,12 +208,13 @@ class KeeMeta(BaseMeta, metaclass=KeeMetaMeta):
208
208
  namespace registered them. A member a base enumeration already has
209
209
  under the name is the same member here, with the 'Kee' and the index
210
210
  it has there; anything else a base holds under the name, such as a
211
- plain class attribute, gives way to a new member. The 'Kee' of a new
212
- member is placed on the enumeration first, as a box is placed on its
213
- class, which refuses a 'Kee' declared without parentheses or
214
- declared in another enumeration already, and then receives its
215
- index, the position of the member. Each member is built by
216
- 'type.__call__', past the call of the class, which resolves, and
211
+ plain class attribute, gives way to a new member, which
212
+ 'KeeSpaceHook' admits only where the upper-case rule holds. The
213
+ 'Kee' of a new member is placed on the enumeration first, as a box
214
+ is placed on its class, which refuses a 'Kee' declared without
215
+ parentheses or declared in another enumeration already, and then
216
+ receives its index, the position of the member. Each member is built
217
+ by 'type.__call__', past the call of the class, which resolves, and
217
218
  each member, inherited or new, records the class among its owners.
218
219
  """
219
220
  type.__setattr__(cls, '__allow_instantiation__', True)
@@ -32,16 +32,20 @@ class KeeSpace(BaseSpace):
32
32
  --------------
33
33
 
34
34
  'KeeSpace' is a 'BaseSpace' with one hook of its own, 'KeeSpaceHook',
35
- which hands every 'Kee' bound in the body to 'addNum'. 'addNum'
36
- refuses a repeated name with 'KeeDuplicate', a 'Kee' already named
37
- otherwise with 'KeeNameConflict', a name that is not upper case
38
- through the 'Kee' setter, and a value type other than the first
39
- member's through 'typeGuard', then records the member. The
35
+ which holds the name of every 'Kee' bound in the body to upper case,
36
+ unless 'strictCase=False' holds for the class, refuses a name that
37
+ 'getNumsIgnoringCase' finds on record in any case, refuses a name a
38
+ base or the metaclass holds where the upper-case rule does not hold,
39
+ and hands the 'Kee' to 'addNum'. 'addNum' refuses a repeated name with
40
+ 'KeeDuplicate', a 'Kee' already named otherwise with
41
+ 'KeeNameConflict', and a value type other than the first member's
42
+ through 'typeGuard', then records the member. The
40
43
  constructor registers a clone of every member of every base that is
41
44
  an enumeration, the bases in order, so the names and the value type
42
45
  are inherited before the body runs. A member reached through two
43
46
  bases, as in a diamond, is one member; two different members under
44
- one name raise 'KeeDuplicate', and bases of different value types
47
+ one name, or under names that differ only by case, raise
48
+ 'KeeDuplicate', and bases of different value types
45
49
  'KeeTypeException'. 'postCompile' writes the pinned value type into
46
50
  the class dictionary as '__member_type__'; 'KeeMeta' reads the
47
51
  members off the namespace as the class is created.
@@ -85,7 +89,7 @@ class KeeSpace(BaseSpace):
85
89
  """
86
90
  if name in self.__enumeration_members__:
87
91
  oldMember = self.__enumeration_members__[name]
88
- raise KeeDuplicate(name, oldMember, member)
92
+ raise KeeDuplicate(self.getClassName(), name, oldMember, member)
89
93
  try:
90
94
  oldName = member.name
91
95
  except AttributeError:
@@ -103,6 +107,40 @@ class KeeSpace(BaseSpace):
103
107
  """
104
108
  return True if name in self.__enumeration_members__ else False
105
109
 
110
+ def getNumsIgnoringCase(self, name: str) -> tuple[Kee, ...]:
111
+ """
112
+ A lookup by name ignores case, so two members whose names differ by
113
+ case alone could not be told apart. Before a member is recorded, it
114
+ must therefore be known whether another one has its name already, in
115
+ any case.
116
+
117
+ Implementation
118
+ --------------
119
+
120
+ The names on record are compared lower-cased, as the table of names
121
+ of the finished class is keyed.
122
+
123
+ Parameters
124
+ ----------
125
+
126
+ name : str
127
+ The name asked about.
128
+
129
+ Returns
130
+ -------
131
+
132
+ tuple[Kee, ...]
133
+ The 'Kee' objects on record, declared in this body or inherited,
134
+ under a name equal to 'name' when case is ignored; empty when there
135
+ is none.
136
+ """
137
+ lowered = name.lower()
138
+ out = []
139
+ for held, member in self.__enumeration_members__.items():
140
+ if held.lower() == lowered:
141
+ out.append(member)
142
+ return (*out,)
143
+
106
144
  def typeGuard(self, member: Kee) -> Kee:
107
145
  """
108
146
  The 'typeGuard' method pins the enumeration to the value type of its
@@ -145,19 +183,28 @@ class KeeSpace(BaseSpace):
145
183
  The '_inheritMember' method records one member of a base. A member
146
184
  the namespace holds already under its name is the same member,
147
185
  reached through another base, unless it is another object, which is
148
- refused with 'KeeDuplicate'. The member's 'Kee' is registered as a
149
- clone, so the base's 'Kee', placed on the base, is never handed to
150
- this body: the class takes the member object itself as it is
151
- created, and the clone serves the name and type checks alone.
186
+ refused with 'KeeDuplicate'. So is a member whose name differs by
187
+ case alone from that of a member another base gave, since a lookup
188
+ by name could not tell the two apart. The member's 'Kee' is
189
+ registered as a clone, so the base's 'Kee', placed on the base, is
190
+ never handed to this body: the class takes the member object itself
191
+ as it is created, and the clone serves the name and type checks
192
+ alone.
152
193
  """
153
194
  name = member.name
195
+ clsName = self.getClassName()
154
196
  inherited = self.__inherited_members__
155
197
  if name in inherited:
156
198
  if inherited[name] is member:
157
199
  # This branch is reached by the following:
158
200
  # - A diamond: two bases hold the member of a common ancestor
159
201
  return
160
- raise KeeDuplicate(name, inherited[name].kee, member.kee)
202
+ raise KeeDuplicate(clsName, name, inherited[name].kee, member.kee)
203
+ for held in self.getNumsIgnoringCase(name):
204
+ # This loop is entered by the following:
205
+ # - Another base gave a member whose name differs by case alone
206
+ oldKee = inherited[held.name].kee
207
+ raise KeeDuplicate(clsName, name, oldKee, member.kee)
161
208
  inherited[name] = member
162
209
  self.addNum(name, member.kee.clone())
163
210
 
@@ -0,0 +1,219 @@
1
+ """
2
+ KeeSpaceHook collects the 'Kee' descriptors from a 'KeeNum' class body.
3
+ """
4
+ # Apache-2.0 license
5
+ # Copyright (c) 2025-2026 Asger Jon Vistisen
6
+ from __future__ import annotations
7
+
8
+ from types import FunctionType
9
+ from typing import TYPE_CHECKING
10
+
11
+ from ..mcls.space_hooks import AbstractSpaceHook
12
+ from ..waitaminute.keenum import KeeMemberNameError, KeeCaseException
13
+ from ..waitaminute.keenum import KeeDuplicate
14
+ from ..waitaminute.meta import UnboundClassHook, ReservedName
15
+ from . import Kee
16
+
17
+ if TYPE_CHECKING: # pragma: no cover, no mutate
18
+ from typing import Any
19
+
20
+ from . import KeeSpace
21
+
22
+
23
+ class KeeSpaceHook(AbstractSpaceHook):
24
+ """
25
+ An enumeration body binds its members as ordinary names, 'RED =
26
+ Kee[int](1)', yet the class must hold members at those names and
27
+ nothing else: a plain value bound at a member's name, before or after
28
+ the member, would be replaced without a word. The 'Kee' objects must
29
+ therefore reach the namespace's record and never its dictionary, and
30
+ a body binding a member's name twice must fail at that line. The
31
+ members are constants, and their names are upper case, which keeps
32
+ them apart from every other name of the class; a name in another case
33
+ must fail at its line as well, unless the class says on its class
34
+ statement that it wants such names, as a class of unit symbols does,
35
+ or is based on a class that said so.
36
+ Whatever their case, two members must not share a name once case is
37
+ ignored, as 'MW' beside 'mW': a lookup by name ignores case and could
38
+ not tell them apart, so the second must fail at its line. And a class
39
+ that gives up the upper-case rule gives up what kept its members apart
40
+ from the other names of the class, as 'members', 'space' and the
41
+ methods of its bases, so a member at such a name must fail at its line
42
+ too, since it would replace that name on the class without a word.
43
+
44
+ Implementation
45
+ --------------
46
+
47
+ 'setItemPhase' hands every 'Kee' to 'addNum' of the namespace and
48
+ claims the binding. A 'Kee' bound at a name the dictionary holds, or
49
+ a plain value bound at a name a member takes, declared or inherited,
50
+ raises 'KeeMemberNameError'. A 'Kee' bound at a name that is not
51
+ upper case raises 'KeeCaseException', unless the class keyword
52
+ 'strictCase=False' holds for the class: '_isStrictCase' reads it off
53
+ the namespace, and for a class statement without it off the nearest
54
+ class along the resolution order that gave it. 'preparePhase' reads
55
+ the keyword once as the namespace is created, so a value that is no
56
+ 'bool' raises 'TypeException' before the body runs, whatever the body
57
+ declares. A 'Kee' bound at a name that 'getNumsIgnoringCase' of the
58
+ namespace finds on record, for a member declared or inherited, in the
59
+ same case or another, raises 'KeeDuplicate'. Where the upper-case rule
60
+ does not hold, a 'Kee' bound at a name that '_isTakenName' finds on a
61
+ base or on the metaclass raises 'ReservedName'. A '__class_resolve__'
62
+ bound to a plain function or a staticmethod raises 'UnboundClassHook',
63
+ as a routed class hook does, since the lookups call the hook bound to
64
+ the class. One hook object serves every body, so it keeps nothing of
65
+ its own.
66
+ """
67
+
68
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
69
+ # DOMAIN SPECIFIC # # # # # # # # # # # # # # # # # # # # # # # # # # # #
70
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
71
+
72
+ def _isStrictCase(self) -> bool:
73
+ """
74
+ The names of the members of an enumeration are upper case, and a
75
+ class that needs names in another case must say so, on its class
76
+ statement, with a value that cannot be misread. A subclass of such a
77
+ class adds members of the same kind and must not have to say it
78
+ again, while a subclass that wants the rule back must be able to
79
+ take it.
80
+
81
+ Implementation
82
+ --------------
83
+
84
+ The class keyword 'strictCase' is read off the namespace with
85
+ 'parseKwargs', which admits a 'bool' alone. A class statement that
86
+ does not give it takes the choice of the nearest class along its
87
+ resolution order whose class statement did, as an attribute is found
88
+ along that order; the keywords of each are read off the
89
+ '__keyword_arguments__' that a worktoy namespace writes into its
90
+ class. With no such class the names are held to upper case.
91
+
92
+ Returns
93
+ -------
94
+
95
+ bool
96
+ Whether the member names of the class body must be upper case.
97
+
98
+ Raises
99
+ ------
100
+
101
+ TypeException
102
+ 'strictCase' is given and is no 'bool'.
103
+ """
104
+ kwargs = self.space.getKwargs()
105
+ strictCase, _ = self.parseKwargs('strictCase', bool, **kwargs)
106
+ if strictCase is not None:
107
+ # This branch is reached by the following:
108
+ # - The class statement gives the 'strictCase' keyword itself
109
+ return strictCase
110
+ for base in self.space._getLookupOrder():
111
+ try:
112
+ given = base.__dict__['__keyword_arguments__']
113
+ except KeyError:
114
+ # This branch is reached by the following:
115
+ # - The base was built by no worktoy namespace, as 'KeeBase', a
116
+ # plain mixin and 'object' are
117
+ continue
118
+ inherited, _ = self.parseKwargs('strictCase', bool, **given)
119
+ if inherited is not None:
120
+ # This branch is reached by the following:
121
+ # - A class along the resolution order gave the keyword
122
+ return inherited
123
+ # The rest of the method is reached by the following:
124
+ # - Neither the class statement nor a class it is based on gives the
125
+ # keyword
126
+ return True
127
+
128
+ def _isTakenName(self, name: str) -> bool:
129
+ """
130
+ The upper-case rule keeps the name of a member apart from every other
131
+ name of its class, none of which is upper case in the library: the
132
+ accessors of the enumeration, as 'members' and 'space', the methods
133
+ of its members, and whatever a base or the metaclass defines. Without
134
+ the rule a member could take such a name, and would then replace the
135
+ accessor or the method on the class without a word, or fail on a
136
+ property of the metaclass with an error that names neither the member
137
+ nor a rule.
138
+
139
+ Implementation
140
+ --------------
141
+
142
+ A name is taken when a class dictionary holds it, along the
143
+ resolution order of the bases or along that of the metaclass. The
144
+ dictionaries are read as they are, so no property is asked for its
145
+ value.
146
+
147
+ Parameters
148
+ ----------
149
+
150
+ name : str
151
+ The name a member is being bound at.
152
+
153
+ Returns
154
+ -------
155
+
156
+ bool
157
+ Whether a base or the metaclass holds the name already.
158
+ """
159
+ metaclass = self.space.getMetaclass()
160
+ for cls in (*self.space._getLookupOrder(), *metaclass.__mro__):
161
+ if name in cls.__dict__:
162
+ return True
163
+ return False
164
+
165
+ def preparePhase(self, space: KeeSpace) -> None:
166
+ """
167
+ A class statement giving 'strictCase' a value that is no 'bool' is
168
+ mistaken whether or not its body declares a member, and the mistake
169
+ must fail before the body runs, not at the line of the first member,
170
+ and not pass unnoticed in a body declaring none.
171
+
172
+ Implementation
173
+ --------------
174
+
175
+ The namespace binds the hook to itself before it runs this phase, so
176
+ '_isStrictCase' reads the keyword of the namespace being created, and
177
+ its refusal leaves the class statement from '__prepare__'. The answer
178
+ itself is not needed here.
179
+
180
+ Parameters
181
+ ----------
182
+
183
+ space : KeeSpace
184
+ The new namespace.
185
+
186
+ Raises
187
+ ------
188
+
189
+ TypeException
190
+ 'strictCase' is given and is no 'bool'.
191
+ """
192
+ self._isStrictCase()
193
+
194
+ def setItemPhase(self, key: str, val: Any, old: Any = None, ) -> bool:
195
+ if key == '__class_resolve__':
196
+ if isinstance(val, (FunctionType, staticmethod)):
197
+ raise UnboundClassHook(self.space.getClassName(), key)
198
+ if isinstance(val, Kee):
199
+ clsName = self.space.getClassName()
200
+ if dict.__contains__(self.space, key):
201
+ raise KeeMemberNameError(clsName, key)
202
+ strictCase = self._isStrictCase()
203
+ if strictCase and not key.isupper():
204
+ raise KeeCaseException(key)
205
+ for held in self.space.getNumsIgnoringCase(key):
206
+ # This loop is entered by the following:
207
+ # - A member, declared or inherited, has the name already
208
+ # - A member has a name that differs from it by case alone
209
+ raise KeeDuplicate(clsName, key, held, val)
210
+ if not strictCase and self._isTakenName(key):
211
+ # This branch is reached by the following:
212
+ # - The class gave up the upper-case rule, and a base or the
213
+ # metaclass holds the name, as 'space', 'members' or a method
214
+ raise ReservedName(key)
215
+ self.space.addNum(key, val)
216
+ return True
217
+ if self.space.hasNum(key):
218
+ raise KeeMemberNameError(self.space.getClassName(), key)
219
+ return False
@@ -13,7 +13,9 @@ class KeeCaseException(WorkToyException, ValueError):
13
13
  """
14
14
  Raised when the name of a 'KeeNum' member or of a 'KeeFlags' flag is
15
15
  not upper case (the check is 'name.isupper()'); lowercase or mixed-case
16
- names are rejected. Lookups by call or subscript ignore case.
16
+ names are rejected, except in a 'KeeNum' class whose class statement,
17
+ or that of a class it is based on, says 'strictCase=False'. Lookups by
18
+ call or subscript ignore case.
17
19
 
18
20
  Attributes
19
21
  ----------
@@ -0,0 +1,65 @@
1
+ """
2
+ KeeDuplicate is raised when a 'KeeNum' class body declares two members
3
+ under the same name, or under names that differ only by case.
4
+ """
5
+ # Apache-2.0 license
6
+ # Copyright (c) 2025-2026 Asger Jon Vistisen
7
+ from __future__ import annotations
8
+
9
+ from typing import TYPE_CHECKING
10
+
11
+ from ...utilities import textFmt
12
+ from .. import WorkToyException
13
+
14
+ if TYPE_CHECKING: # pragma: no cover, no mutate
15
+ from ...keenum import Kee
16
+
17
+
18
+ class KeeDuplicate(WorkToyException, Exception):
19
+ """
20
+ Raised on a member name collision in a 'KeeNum' enumeration: either a
21
+ class body that declares the same name twice, or a subclass that
22
+ redeclares a name it already inherits (overriding an inherited member is
23
+ not allowed). This is a name collision, not a value collision; duplicate
24
+ values are allowed.
25
+
26
+ Two names that differ only by case collide as well, since a lookup by
27
+ name ignores case and could not tell their members apart: 'MW' beside
28
+ 'mW' in a class declared with 'strictCase=False', a subclass adding
29
+ 'MW' to an inherited 'mw', or two bases holding such a pair.
30
+
31
+ The refusal comes while the class body runs, or before it, so the
32
+ enumeration does not exist yet and is given by its name.
33
+
34
+ Attributes
35
+ ----------
36
+ clsName : str
37
+ The name of the enumeration class under construction.
38
+ name : str
39
+ The member name that was refused.
40
+ oldMember : Kee
41
+ The member already registered under 'name', or under a name that
42
+ differs from it by case alone.
43
+ newMember : Kee
44
+ The member whose registration was rejected.
45
+ """
46
+
47
+ __slots__ = ('clsName', 'name', 'oldMember', 'newMember',)
48
+
49
+ def __init__(self, clsName: str, name: str, *members: Kee) -> None:
50
+ self.clsName = clsName
51
+ self.name = name
52
+ self.oldMember = members[0]
53
+ self.newMember = members[1]
54
+ Exception.__init__(self, )
55
+
56
+ def __str__(self, ) -> str:
57
+ infoSpec = """Enumeration '%s' already contains member: '%s', and
58
+ cannot take another member named '%s'! The names of the members of an
59
+ enumeration must differ by more than their case, since a lookup by
60
+ name ignores case."""
61
+ oldStr = str(self.oldMember)
62
+ info = infoSpec % (self.clsName, oldStr, self.name,)
63
+ return textFmt(info)
64
+
65
+ __repr__ = __str__
@@ -16,8 +16,11 @@ class ReservedName(WorkToyException, SyntaxError):
16
16
  interpreter or the metaclass system reserves and populates automatically,
17
17
  such as '__dict__', '__module__', '__qualname__', or '__match_args__'.
18
18
  The guard fires only on reassignment, so deferred initialisation of such
19
- a name is still allowed. It subclasses 'SyntaxError', as the other
20
- refusals of a class-body line do.
19
+ a name is still allowed. It is raised as well for a name a class of
20
+ the library keeps for itself: a 'Kee' bound, in an enumeration that
21
+ gave up the upper-case rule with 'strictCase=False', at a name a base
22
+ or the metaclass holds already, as 'members' or 'space'. It subclasses
23
+ 'SyntaxError', as the other refusals of a class-body line do.
21
24
 
22
25
  Attributes
23
26
  ----------
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: worktoy
3
- Version: 1.2.1rc0
3
+ Version: 1.2.2.dev0
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.2.1-rc0 (release candidate)
35
+ # worktoy v1.2.2-dev0 (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
@@ -1,57 +0,0 @@
1
- """
2
- KeeSpaceHook collects the 'Kee' descriptors from a 'KeeNum' class body.
3
- """
4
- # Apache-2.0 license
5
- # Copyright (c) 2025-2026 Asger Jon Vistisen
6
- from __future__ import annotations
7
-
8
- from types import FunctionType
9
- from typing import TYPE_CHECKING
10
-
11
- from ..mcls.space_hooks import AbstractSpaceHook
12
- from ..waitaminute.keenum import KeeMemberNameError
13
- from ..waitaminute.meta import UnboundClassHook
14
- from . import Kee
15
-
16
- if TYPE_CHECKING: # pragma: no cover, no mutate
17
- from typing import Any
18
-
19
-
20
- class KeeSpaceHook(AbstractSpaceHook):
21
- """
22
- An enumeration body binds its members as ordinary names, 'RED =
23
- Kee[int](1)', yet the class must hold members at those names and
24
- nothing else: a plain value bound at a member's name, before or after
25
- the member, would be replaced without a word. The 'Kee' objects must
26
- therefore reach the namespace's record and never its dictionary, and
27
- a body binding a member's name twice must fail at that line.
28
-
29
- Implementation
30
- --------------
31
-
32
- 'setItemPhase' hands every 'Kee' to 'addNum' of the namespace and
33
- claims the binding. A 'Kee' bound at a name the dictionary holds, or
34
- a plain value bound at a name a member takes, declared or inherited,
35
- raises 'KeeMemberNameError'; two 'Kee' objects of one name raise
36
- 'KeeDuplicate' from 'addNum'. A '__class_resolve__' bound to a plain
37
- function or a staticmethod raises 'UnboundClassHook', as a routed
38
- class hook does, since the lookups call the hook bound to the class.
39
- One hook object serves every body, so it keeps nothing of its own.
40
- """
41
-
42
- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
43
- # DOMAIN SPECIFIC # # # # # # # # # # # # # # # # # # # # # # # # # # # #
44
- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
45
-
46
- def setItemPhase(self, key: str, val: Any, old: Any = None, ) -> bool:
47
- if key == '__class_resolve__':
48
- if isinstance(val, (FunctionType, staticmethod)):
49
- raise UnboundClassHook(self.space.getClassName(), key)
50
- if isinstance(val, Kee):
51
- if dict.__contains__(self.space, key):
52
- raise KeeMemberNameError(self.space.getClassName(), key)
53
- self.space.addNum(key, val)
54
- return True
55
- if self.space.hasNum(key):
56
- raise KeeMemberNameError(self.space.getClassName(), key)
57
- return False
@@ -1,52 +0,0 @@
1
- """
2
- KeeDuplicate is raised when a 'KeeNum' class body declares two members
3
- under the same name.
4
- """
5
- # Apache-2.0 license
6
- # Copyright (c) 2025-2026 Asger Jon Vistisen
7
- from __future__ import annotations
8
-
9
- from typing import TYPE_CHECKING
10
-
11
- from ...utilities import textFmt
12
- from .. import WorkToyException
13
-
14
- if TYPE_CHECKING: # pragma: no cover, no mutate
15
- from ...keenum import Kee
16
-
17
-
18
- class KeeDuplicate(WorkToyException, Exception):
19
- """
20
- Raised on a member name collision in a 'KeeNum' enumeration: either a
21
- class body that declares the same name twice, or a subclass that
22
- redeclares a name it already inherits (overriding an inherited member is
23
- not allowed). This is a name collision, not a value collision; duplicate
24
- values are allowed.
25
-
26
- Attributes
27
- ----------
28
- name : str
29
- The member name declared more than once.
30
- oldMember : Kee
31
- The member already registered under 'name'.
32
- newMember : Kee
33
- The member whose registration was rejected.
34
- """
35
-
36
- __slots__ = ('name', 'oldMember', 'newMember',)
37
-
38
- def __init__(self, name: str, *members: Kee) -> None:
39
- self.name = name
40
- self.oldMember = members[0]
41
- self.newMember = members[1]
42
- Exception.__init__(self, )
43
-
44
- def __str__(self, ) -> str:
45
- infoSpec = """Enumeration name '%s' already contains member: '%s',
46
- but attempted to add duplicate member: '%s'!"""
47
- oldStr = str(self.oldMember)
48
- newStr = str(self.newMember)
49
- info = infoSpec % (self.name, oldStr, newStr,)
50
- return textFmt(info)
51
-
52
- __repr__ = __str__
File without changes
File without changes