worktoy 1.1.0rc0__tar.gz → 1.2.0.dev1__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.
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/PKG-INFO +4 -5
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/README.md +2 -2
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/pyproject.toml +4 -4
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/__init__.py +1 -1
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/desc/_attri_box.py +3 -2
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/desc/_base_descriptor.py +11 -11
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/dispatch/_dispatcher.py +16 -9
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/keenum/__init__.py +6 -4
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/keenum/_kee_box.py +69 -44
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/keenum/_kee_flag.py +31 -27
- worktoy-1.2.0.dev1/src/worktoy/keenum/_kee_flags.py +368 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/keenum/_kee_flags_hook.py +11 -10
- worktoy-1.2.0.dev1/src/worktoy/keenum/_kee_flags_meta.py +475 -0
- worktoy-1.2.0.dev1/src/worktoy/keenum/_kee_flags_space.py +163 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/keenum/_kee_member.py +47 -6
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/keenum/_kee_meta.py +214 -183
- worktoy-1.2.0.dev1/src/worktoy/keenum/_kee_num.py +274 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/keenum/_kee_space.py +37 -16
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_class_body_template.py +16 -9
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_resolve_mro.py +2 -2
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_text_fmt.py +3 -2
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_word_wrap.py +7 -4
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/__init__.py +19 -1
- worktoy-1.2.0.dev1/src/worktoy/waitaminute/_alternative_warning.py +61 -0
- worktoy-1.2.0.dev1/src/worktoy/waitaminute/_deprecated_promise.py +64 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/_missing_variable.py +2 -1
- worktoy-1.2.0.dev1/src/worktoy/waitaminute/_risk_warning.py +63 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/_subclass_exception.py +2 -1
- worktoy-1.2.0.dev1/src/worktoy/waitaminute/_work_toy_warning.py +164 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/control_flow/__init__.py +18 -5
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/keenum/_kee_flag_duplicate.py +10 -9
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/keenum/_kee_type_exception.py +12 -7
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/_base_test.py +31 -1
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy.egg-info/PKG-INFO +4 -5
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy.egg-info/SOURCES.txt +4 -0
- worktoy-1.1.0rc0/src/worktoy/keenum/_kee_flags.py +0 -352
- worktoy-1.1.0rc0/src/worktoy/keenum/_kee_flags_meta.py +0 -337
- worktoy-1.1.0rc0/src/worktoy/keenum/_kee_flags_space.py +0 -195
- worktoy-1.1.0rc0/src/worktoy/keenum/_kee_num.py +0 -249
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/LICENSE +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/setup.cfg +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/_instance_owner.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/_meta_type.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/_object.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/control_flow/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/control_flow/_control_flow.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/control_flow/_control_space.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/control_flow/_meta_flow.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/control_flow/_skip_set.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/sentinels/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/sentinels/_args.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/sentinels/_deleted.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/sentinels/_desc.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/sentinels/_meta_call.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/sentinels/_owner.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/sentinels/_sentinel.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/core/sentinels/_this.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/desc/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/desc/_alias.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/desc/_fast_box.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/desc/_field.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/desc/_fix_box.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/desc/_root_alias.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/desc/_symbolic_name.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/dispatch/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/dispatch/_call_me_maybe.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/dispatch/_flex_call.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/dispatch/_overload.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/dispatch/_permuter.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/dispatch/_permuter_method.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/dispatch/_type_sig.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/ezdata/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/ezdata/_ez_data.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/ezdata/_ez_field.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/ezdata/_ez_hook.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/ezdata/_ez_meta.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/ezdata/_ez_space.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/ezdata/_ez_store.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/ezdata/_fields.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/keenum/_access_num.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/keenum/_kee_meta_meta.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/keenum/_kee_space_hook.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/lorem_ipsum/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/lorem_ipsum/_base_generator.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/lorem_ipsum/_clause.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/lorem_ipsum/_gaussian_lengths.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/lorem_ipsum/_paragraph.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/lorem_ipsum/_sentence.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/lorem_ipsum/_stochastic_variable.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/lorem_ipsum/_stochastic_word.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/lorem_ipsum/_words.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/_abstract_metaclass.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/_abstract_namespace.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/_base_meta.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/_base_object.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/_base_space.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/space_hooks/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/space_hooks/_abstract_space_hook.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/space_hooks/_flex_call_hook.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/space_hooks/_load_space_hook.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/space_hooks/_name_hook.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/space_hooks/_reserved_names.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/space_hooks/_reserved_namespace_hook.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/mcls/space_hooks/_space_desc.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/py.typed +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_args_count.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_bipartite_matching.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_directory.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_exception_info.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_join_words.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_maybe.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_quick_desc.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_replace_flex.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_slice_len.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_string_list.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_type_cast.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_unpack.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/_valid_slice.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/combinatorics/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/combinatorics/_arrangement.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/combinatorics/_arrangements.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/utilities/combinatorics/_index_permutations.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/_type_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/_uncheckable_type.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/_unpack_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/_variable_not_none.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/_work_toy_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_access_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_dangling_alias.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_descriptor_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_missing_instance_dict.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_nameless_callback.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_not_a_descriptor.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_overload_reference.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_phantom_box_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_protected_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_read_only_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_recursive_read.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_reference_conflict.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_shared_descriptor.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_without_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/desc/_write_once_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/dispatch/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/dispatch/_bare_overload.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/dispatch/_dispatch_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/dispatch/_duplicate_signature.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/dispatch/_type_cast_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/dispatch/_unbound_cast_hook.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/ezdata/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/ezdata/_class_field_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/ezdata/_duplicate_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/ezdata/_extra_keyword_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/ezdata/_extra_positional_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/ezdata/_incomplete_field_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/ezdata/_kw_only_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/ezdata/_repeated_field_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/ezdata/_reserved_attribute_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/ezdata/_reserved_field_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/ezdata/_reserved_method_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/keenum/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/keenum/_kee_box_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/keenum/_kee_box_type_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/keenum/_kee_box_value_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/keenum/_kee_case_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/keenum/_kee_duplicate.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/keenum/_kee_flag_name_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/keenum/_kee_member_name_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/keenum/_kee_name_conflict.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/keenum/_kee_resolve_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/keenum/_kee_write_once_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_claimed_name.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_control_class_error.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_del_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_duplicate_hook.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_duplicate_sentinel.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_hook_exception.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_illegal_instantiation.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_mixed_method_kind.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_overload_conflict.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_questionable_syntax.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_rebound_overload.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_reserved_name.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_shadowed_class_hook.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_slots_refused.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/waitaminute/meta/_unbound_class_hook.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/_complex_mixin.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/_complex_test.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/_sub_test.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/samplers/__init__.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/samplers/_base_sampler.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/samplers/_float_sampler.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/samplers/_gaussian_sampler.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/samplers/_int_sampler.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/samplers/_lorem_sampler.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/samplers/_lorem_text.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/samplers/_sampler_meta.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/samplers/_symbolic_sampler.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy/work_test/samplers/_word_sampler.py +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy.egg-info/dependency_links.txt +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/src/worktoy.egg-info/top_level.txt +0 -0
- {worktoy-1.1.0rc0 → worktoy-1.2.0.dev1}/tests/test_smoke.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: worktoy
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0.dev1
|
|
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
|
-
License: Apache-2.0
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
7
|
Project-URL: Homepage, https://github.com/AsgerJon/WorkToy
|
|
8
8
|
Project-URL: Bug Tracker, https://github.com/AsgerJon/WorkToy/issues
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.7
|
|
@@ -16,7 +16,6 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.14
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.15
|
|
18
18
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
19
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
20
19
|
Classifier: Operating System :: OS Independent
|
|
21
20
|
Classifier: Development Status :: 5 - Production/Stable
|
|
22
21
|
Classifier: Intended Audience :: Developers
|
|
@@ -28,12 +27,12 @@ License-File: LICENSE
|
|
|
28
27
|
Dynamic: license-file
|
|
29
28
|
|
|
30
29
|
[](https://wakatime.com/badge/github/AsgerJon/WorkToy)
|
|
31
|
-
[](https://claude.com/claude-code)
|
|
32
31
|
[](https://codecov.io/gh/AsgerJon/WorkToy)
|
|
33
32
|
[](https://pypi.org/project/worktoy/)
|
|
34
33
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
35
34
|
|
|
36
|
-
# worktoy v1.
|
|
35
|
+
# worktoy v1.2.0-dev1 (development build)
|
|
37
36
|
|
|
38
37
|
**worktoy** provides utilities for Python development focused on
|
|
39
38
|
reducing boilerplate while improving type safety and readability. Each
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[](https://wakatime.com/badge/github/AsgerJon/WorkToy)
|
|
2
|
-
[](https://claude.com/claude-code)
|
|
3
3
|
[](https://codecov.io/gh/AsgerJon/WorkToy)
|
|
4
4
|
[](https://pypi.org/project/worktoy/)
|
|
5
5
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
6
|
|
|
7
|
-
# worktoy v1.
|
|
7
|
+
# worktoy v1.2.0-dev1 (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
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ['setuptools>=
|
|
2
|
+
requires = ['setuptools>=77.0.0'] # PEP 639 licence metadata
|
|
3
3
|
build-backend = 'setuptools.build_meta'
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "worktoy"
|
|
8
|
-
version = "1.
|
|
8
|
+
version = "1.2.0-dev1"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Asger Jon Vistisen", email = "asgerjon2@gmail.com" },
|
|
11
11
|
]
|
|
12
12
|
description = "Declarative structure for Python that enforces types at runtime and enables true function overloading"
|
|
13
13
|
readme = "README.md"
|
|
14
|
-
license =
|
|
14
|
+
license = "Apache-2.0"
|
|
15
|
+
license-files = ["LICENSE"]
|
|
15
16
|
requires-python = ">=3.7"
|
|
16
17
|
classifiers = [
|
|
17
18
|
'Programming Language :: Python :: 3.7',
|
|
@@ -24,7 +25,6 @@ classifiers = [
|
|
|
24
25
|
'Programming Language :: Python :: 3.14',
|
|
25
26
|
'Programming Language :: Python :: 3.15',
|
|
26
27
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
27
|
-
"License :: OSI Approved :: Apache Software License",
|
|
28
28
|
"Operating System :: OS Independent",
|
|
29
29
|
"Development Status :: 5 - Production/Stable",
|
|
30
30
|
"Intended Audience :: Developers",
|
|
@@ -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.
|
|
51
|
+
__version__ = '1.2.0-dev1'
|
|
52
52
|
|
|
53
53
|
from . import utilities
|
|
54
54
|
from . import waitaminute
|
|
@@ -246,8 +246,8 @@ class AttriBox(BaseDescriptor[T]):
|
|
|
246
246
|
arguments of the '%s' constructor instead: '%s[%s](...)'."""
|
|
247
247
|
typeName = fieldType.__name__
|
|
248
248
|
info = infoSpec % (
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
self.getFieldOwner().__name__, self.getFieldName(), typeName,
|
|
250
|
+
typeName, type(self).__name__, typeName,
|
|
251
251
|
)
|
|
252
252
|
raise TypeError(textFmt(info)) from exception
|
|
253
253
|
else:
|
|
@@ -445,6 +445,7 @@ class AttriBox(BaseDescriptor[T]):
|
|
|
445
445
|
cast = self._cast(value)
|
|
446
446
|
return self.__instance_set__(
|
|
447
447
|
instance, cast, _recursion=True) # pragma: no mutate
|
|
448
|
+
|
|
448
449
|
def __instance_delete__(self, instance: Any, *_, **kwargs) -> None:
|
|
449
450
|
"""
|
|
450
451
|
After a deletion the next read must fail, and must not build the
|
|
@@ -38,8 +38,8 @@ class BaseDescriptor(Object, Generic[T]):
|
|
|
38
38
|
--------------
|
|
39
39
|
|
|
40
40
|
Seven decorators register a method of the owning class: 'preGet' and
|
|
41
|
-
'onGet' around a read, 'preSet' and 'onSet' around a write,
|
|
42
|
-
'preDelete' and 'onDelete' around a deletion, and 'setName' when the
|
|
41
|
+
'onGet' around a 'read', 'preSet' and 'onSet' around a 'write',
|
|
42
|
+
'preDelete' and 'onDelete' around a 'deletion', and 'setName' when the
|
|
43
43
|
descriptor is placed, for which the method is a classmethod receiving
|
|
44
44
|
the class and the descriptor:
|
|
45
45
|
|
|
@@ -173,12 +173,12 @@ class BaseDescriptor(Object, Generic[T]):
|
|
|
173
173
|
if isinstance(func, Func):
|
|
174
174
|
return kind, func
|
|
175
175
|
raise TypeException(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
176
|
+
'callback',
|
|
177
|
+
callback,
|
|
178
|
+
Func,
|
|
179
|
+
classmethod,
|
|
180
|
+
staticmethod
|
|
181
|
+
)
|
|
182
182
|
|
|
183
183
|
@classmethod
|
|
184
184
|
def _wrapCallback(cls, callback: Any) -> Any:
|
|
@@ -373,9 +373,9 @@ class BaseDescriptor(Object, Generic[T]):
|
|
|
373
373
|
cls = type(self)
|
|
374
374
|
new = object.__new__(cls)
|
|
375
375
|
skipped = (
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
376
|
+
'__field_owner__',
|
|
377
|
+
'__field_name__',
|
|
378
|
+
'__private_name__',
|
|
379
379
|
)
|
|
380
380
|
for key, value in vars(self).items():
|
|
381
381
|
if key in skipped:
|
|
@@ -223,10 +223,13 @@ class Dispatcher(Object):
|
|
|
223
223
|
signatures, most recent first.
|
|
224
224
|
3. A cast of each argument that is not an instance, where a number
|
|
225
225
|
class takes only a narrower number, 'int' to 'float' to 'complex',
|
|
226
|
-
and every other class casts as 'typeCast' allows
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
and every other class casts as 'typeCast' allows: the concrete
|
|
227
|
+
signatures, then the flexible declarations, then the variadic
|
|
228
|
+
signatures, each kind farthest class first. A subclass therefore
|
|
229
|
+
never redirects a call its parent handled through a cast to a
|
|
230
|
+
signature of the same kind, but a concrete signature of a subclass
|
|
231
|
+
takes a call its parent handled through a cast to a flexible or a
|
|
232
|
+
variadic one.
|
|
230
233
|
4. The same with every cast 'typeCast' allows, narrowing included, as
|
|
231
234
|
'2.0' to the 'int' '2'.
|
|
232
235
|
5. The fallback, if any, else 'DispatchException'.
|
|
@@ -444,7 +447,10 @@ class Dispatcher(Object):
|
|
|
444
447
|
) -> SigFuncList:
|
|
445
448
|
"""
|
|
446
449
|
Adding a signature in a subclass must never redirect a call its parent
|
|
447
|
-
already handled through a cast of the same tier
|
|
450
|
+
already handled through a cast of the same tier to a signature of the
|
|
451
|
+
same kind. The cast pass tries the concrete signatures before the
|
|
452
|
+
flexible and the variadic ones, so this order holds within one kind
|
|
453
|
+
of signature only.
|
|
448
454
|
|
|
449
455
|
Implementation
|
|
450
456
|
--------------
|
|
@@ -715,10 +721,11 @@ class Dispatcher(Object):
|
|
|
715
721
|
def matchCasts(args: tuple, cast: Callable) -> Any:
|
|
716
722
|
"""The function, and the arguments in the order it takes them, of
|
|
717
723
|
the registration accepting 'args' when 'cast' is applied to each
|
|
718
|
-
argument that is not an instance
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
724
|
+
argument that is not an instance: the concrete signatures, then the
|
|
725
|
+
flexible declarations, then the variadic ones, each kind farthest
|
|
726
|
+
class first, and within a class the concrete and flexible ones in
|
|
727
|
+
registration order, the variadic ones most recent first. None when
|
|
728
|
+
none accepts the call."""
|
|
722
729
|
for sig, func in castFuncs:
|
|
723
730
|
if len(args) != len(sig):
|
|
724
731
|
continue
|
|
@@ -3,10 +3,12 @@ The 'worktoy.keenum' package builds two enumeration systems on the
|
|
|
3
3
|
metaclass and descriptor machinery from 'worktoy.mcls' and
|
|
4
4
|
'worktoy.desc'. 'KeeNum' is the value enumeration: 'Kee' members declared
|
|
5
5
|
in the class body are collected by a space hook and frozen into typed
|
|
6
|
-
members by 'KeeMeta'. 'KeeFlags' is the bitmask-flag enumeration:
|
|
7
|
-
'
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
members by 'KeeMeta'. 'KeeFlags' is the bitmask-flag enumeration: its
|
|
7
|
+
flags are declared with 'Kee' as well, each one bit, and 'KeeFlagsMeta'
|
|
8
|
+
gives the class every combination of them as a member. In both systems
|
|
9
|
+
an enumeration may be based on several, and holds the very members of
|
|
10
|
+
its bases. 'KeeBox', deprecated, adapts either system for use as an
|
|
11
|
+
'AttriBox' field type.
|
|
10
12
|
|
|
11
13
|
KeeNum machinery:
|
|
12
14
|
|
|
@@ -10,7 +10,8 @@ from typing import TYPE_CHECKING
|
|
|
10
10
|
|
|
11
11
|
from . import KeeMeta, KeeFlagsMeta
|
|
12
12
|
from ..desc import AttriBox
|
|
13
|
-
from ..
|
|
13
|
+
from ..utilities import textFmt
|
|
14
|
+
from ..waitaminute import TypeException, DeprecatedPromise
|
|
14
15
|
from ..waitaminute.keenum import KeeBoxException, \
|
|
15
16
|
KeeBoxValueError, KeeBoxTypeError
|
|
16
17
|
|
|
@@ -20,6 +21,12 @@ if TYPE_CHECKING: # pragma: no cover, no mutate
|
|
|
20
21
|
|
|
21
22
|
class KeeBox(AttriBox):
|
|
22
23
|
"""
|
|
24
|
+
'KeeBox' is deprecated: it is no longer a promised feature beginning
|
|
25
|
+
with the next major update, and every subscript of it gives a
|
|
26
|
+
'DeprecatedPromise' at the line that wrote the subscript. It works
|
|
27
|
+
as it did. An 'AttriBox' over the enumeration, with the member itself
|
|
28
|
+
as the default, declares the same field.
|
|
29
|
+
|
|
23
30
|
A field typed with an enumeration is declared with the member it
|
|
24
31
|
starts as, and a project wants to write that member the way it
|
|
25
32
|
thinks of it: by name, by the arguments of the value it carries, by
|
|
@@ -43,15 +50,18 @@ class KeeBox(AttriBox):
|
|
|
43
50
|
either kind, 'KeeMeta' or 'KeeFlagsMeta', and whose '_resolve' builds
|
|
44
51
|
the value of the parentheses by its own steps instead of calling the
|
|
45
52
|
class with them. For a 'KeeNum' class, a lone member is taken as it
|
|
46
|
-
is; a lone 'str' is a name,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
refused with 'KeeBoxValueError'
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
is; a lone 'str' is a name, in any case; a lone argument the
|
|
54
|
+
enumeration's '__class_resolve__' answers for is that answer, the hook
|
|
55
|
+
being asked where a call of the class asks it, after the name and
|
|
56
|
+
before the position; a lone 'int' other than a 'bool' is a position
|
|
57
|
+
when it is in range; a lone 'bool' is no value of an 'int' enumeration
|
|
58
|
+
and is refused with 'KeeBoxValueError', as the class refuses it; a
|
|
59
|
+
lone instance of the value type is looked up among the member values
|
|
60
|
+
as a call of the class looks it up, and refused with
|
|
61
|
+
'KeeBoxValueError' when no member carries it; any other arguments,
|
|
62
|
+
keywords included, build an instance of the value type, refused with
|
|
63
|
+
'KeeBoxTypeError' when the constructor raises, and that instance is
|
|
64
|
+
looked up the same way. For a 'KeeFlags' class every
|
|
55
65
|
argument, or every element of a lone tuple, list or set, is resolved
|
|
56
66
|
as subscripting the class resolves it, and the member having every
|
|
57
67
|
flag high that any of them has is the value. A member a 'KeeBox'
|
|
@@ -72,15 +82,18 @@ class KeeBox(AttriBox):
|
|
|
72
82
|
The '_isMember' method reports whether 'value' is a member of the
|
|
73
83
|
field enumeration, a member of a subclass of it included.
|
|
74
84
|
"""
|
|
75
|
-
return True if isinstance(value, self.
|
|
85
|
+
return True if isinstance(value, self.getFieldType()) else False
|
|
76
86
|
|
|
77
87
|
def _resolve(self, *args, **kwargs) -> Any:
|
|
78
88
|
"""
|
|
79
89
|
The box builds the value of its parentheses from the arguments of
|
|
80
90
|
the declaration, placeholders replaced, as every box does; here the
|
|
81
|
-
build is a resolution by the steps the class docstring lists.
|
|
91
|
+
build is a resolution by the steps the class docstring lists. The
|
|
92
|
+
field type is read through 'getFieldType', past the 'fieldType'
|
|
93
|
+
descriptor, since every instance pays for the build at its first
|
|
94
|
+
read.
|
|
82
95
|
"""
|
|
83
|
-
fieldNum = self.
|
|
96
|
+
fieldNum = self.getFieldType()
|
|
84
97
|
if isinstance(fieldNum, KeeMeta):
|
|
85
98
|
return self._resolveNum(*args, **kwargs)
|
|
86
99
|
if isinstance(fieldNum, KeeFlagsMeta):
|
|
@@ -90,43 +103,51 @@ class KeeBox(AttriBox):
|
|
|
90
103
|
def _resolveNum(self, *args, **kwargs) -> Any:
|
|
91
104
|
"""
|
|
92
105
|
The '_resolveNum' method resolves the arguments of the parentheses
|
|
93
|
-
to a member of a 'KeeNum' field type: a lone member, name,
|
|
94
|
-
or value, else an instance of the
|
|
95
|
-
arguments and
|
|
106
|
+
to a member of a 'KeeNum' field type: a lone member, name, answer of
|
|
107
|
+
'__class_resolve__', position or value, else an instance of the
|
|
108
|
+
value type built from the arguments and looked up as a value.
|
|
96
109
|
"""
|
|
97
|
-
fieldNum = self.
|
|
110
|
+
fieldNum = self.getFieldType()
|
|
98
111
|
valueType = fieldNum.valueType
|
|
99
112
|
if len(args) == 1 and not kwargs:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return member
|
|
109
|
-
if isinstance(args[0], int) and not isinstance(args[0], bool):
|
|
110
|
-
if 0 <= args[0] < len(fieldNum):
|
|
111
|
-
return fieldNum[args[0]]
|
|
112
|
-
if isinstance(args[0], bool) and valueType is int:
|
|
113
|
+
arg = args[0]
|
|
114
|
+
if self._isMember(arg):
|
|
115
|
+
return arg
|
|
116
|
+
if isinstance(arg, str):
|
|
117
|
+
member = fieldNum._resolveFromName(arg)
|
|
118
|
+
if member is not NotImplemented:
|
|
119
|
+
return member
|
|
120
|
+
if fieldNum.__custom_resolve__:
|
|
113
121
|
# This branch is reached by the following:
|
|
114
|
-
# - The
|
|
115
|
-
#
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
# - The enumeration defines '__class_resolve__', which a call of
|
|
123
|
+
# the class asks after the name and before the position
|
|
124
|
+
member = fieldNum.__class_resolve__(arg)
|
|
125
|
+
if member is not NotImplemented:
|
|
126
|
+
return member
|
|
127
|
+
if isinstance(arg, int) and not isinstance(arg, bool):
|
|
128
|
+
if 0 <= arg < len(fieldNum):
|
|
129
|
+
return fieldNum.members[arg]
|
|
130
|
+
# A lone 'bool' for an 'int' enumeration is refused by the value
|
|
131
|
+
# lookup of the class, as a call of the class refuses it.
|
|
132
|
+
if isinstance(arg, valueType):
|
|
133
|
+
return self._resolveValue(fieldNum, arg)
|
|
122
134
|
try:
|
|
123
135
|
tempObject = valueType(*args, **kwargs)
|
|
124
136
|
except Exception as exception:
|
|
125
137
|
raise KeeBoxTypeError(self, *args) from exception
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
138
|
+
return self._resolveValue(fieldNum, tempObject)
|
|
139
|
+
|
|
140
|
+
def _resolveValue(self, fieldNum: KeeMeta, value: Any) -> Any:
|
|
141
|
+
"""
|
|
142
|
+
The '_resolveValue' method gives the first member carrying 'value',
|
|
143
|
+
looked up in the value table of the enumeration as a call of the
|
|
144
|
+
class looks it up, and raises 'KeeBoxValueError' naming the value
|
|
145
|
+
when no member carries it.
|
|
146
|
+
"""
|
|
147
|
+
member = fieldNum._resolveFromValue(value, fieldNum.valueType)
|
|
148
|
+
if member is NotImplemented:
|
|
149
|
+
raise KeeBoxValueError(self, fieldNum, value)
|
|
150
|
+
return member
|
|
130
151
|
|
|
131
152
|
def _resolveFlags(self, *args, ) -> Any:
|
|
132
153
|
"""
|
|
@@ -139,7 +160,7 @@ class KeeBox(AttriBox):
|
|
|
139
160
|
"""
|
|
140
161
|
if len(args) == 1 and isinstance(args[0], (tuple, list, set, frozenset)):
|
|
141
162
|
args = (*args[0],)
|
|
142
|
-
fieldNum = self.
|
|
163
|
+
fieldNum = self.getFieldType()
|
|
143
164
|
names = set()
|
|
144
165
|
for arg in args:
|
|
145
166
|
names.update(fieldNum[arg].names)
|
|
@@ -157,8 +178,12 @@ class KeeBox(AttriBox):
|
|
|
157
178
|
'TypeException' otherwise, before delegating to
|
|
158
179
|
'AttriBox.__class_getitem__'. The restriction simplifies the
|
|
159
180
|
implementation; plain 'AttriBox' performs no such check and accepts
|
|
160
|
-
every 'type'.
|
|
181
|
+
every 'type'. Every subscript first gives the deprecation notice of
|
|
182
|
+
'KeeBox', at the line that wrote the subscript.
|
|
161
183
|
"""
|
|
184
|
+
info = """Declare the field with 'AttriBox' instead, giving the
|
|
185
|
+
member itself as the default."""
|
|
186
|
+
DeprecatedPromise(KeeBox, textFmt(info)).warn()
|
|
162
187
|
if isinstance(fieldType, KeeMeta) or isinstance(fieldType, KeeFlagsMeta):
|
|
163
188
|
return super().__class_getitem__(fieldType)
|
|
164
189
|
raise TypeException('fieldType', fieldType, KeeMeta, KeeFlagsMeta)
|
|
@@ -8,9 +8,8 @@ from __future__ import annotations
|
|
|
8
8
|
import typing
|
|
9
9
|
from typing import TYPE_CHECKING
|
|
10
10
|
|
|
11
|
-
from ..desc import Field
|
|
12
11
|
from ..utilities import textFmt, maybe
|
|
13
|
-
from ..waitaminute import MissingVariable, TypeException
|
|
12
|
+
from ..waitaminute import MissingVariable, TypeException, DeprecatedPromise
|
|
14
13
|
|
|
15
14
|
if TYPE_CHECKING: # pragma: no cover, no mutate
|
|
16
15
|
from typing import Any, Tuple, Self, Iterator, Never
|
|
@@ -20,13 +19,16 @@ if TYPE_CHECKING: # pragma: no cover, no mutate
|
|
|
20
19
|
class KeeFlag:
|
|
21
20
|
"""
|
|
22
21
|
KeeFlag declares one single-bit flag inside a 'KeeFlags' class body.
|
|
22
|
+
It is deprecated: each 'KeeFlag' made gives a 'DeprecatedPromise' at
|
|
23
|
+
the line that made it, and declares its flag as it did. A 'Kee'
|
|
24
|
+
declares a flag instead, as 'READ = Kee[str]()'.
|
|
25
|
+
|
|
23
26
|
Despite the name it is not itself an enumeration; the 'KeeFlags'
|
|
24
27
|
metaclass reads the declared flags and builds the members, one per
|
|
25
|
-
combination of flags
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Then the members are created as wrappers on these instances.
|
|
28
|
+
combination of flags, the flag itself among them. The 'KeeFlag' is the
|
|
29
|
+
declaration of a flag, kept on the member as its 'kee', and receives
|
|
30
|
+
the class that built the flag as its owner and the bit of the flag as
|
|
31
|
+
its index.
|
|
30
32
|
|
|
31
33
|
Where the 'Kee' class allows the novel syntactic sugar of 'Kee[int](1)',
|
|
32
34
|
'KeeFlag' requires the owning 'KeeFlags' class to specify the type of the
|
|
@@ -35,8 +37,13 @@ class KeeFlag:
|
|
|
35
37
|
however that when retrieving members by value, the member having the
|
|
36
38
|
lowest index is used.
|
|
37
39
|
|
|
40
|
+
The flags are read for every member as the class is created, so their
|
|
41
|
+
attributes are builtin properties over the private values, not worktoy
|
|
42
|
+
descriptors.
|
|
43
|
+
|
|
38
44
|
Attributes (on the 'KeeFlag' itself, describing the single flag, not
|
|
39
45
|
the wrapped 'KeeFlags' member):
|
|
46
|
+
|
|
40
47
|
- name: The flag's name, set from the class-body assignment by
|
|
41
48
|
'KeeFlagsSpace.addKeeFlag'.
|
|
42
49
|
- index: The flag's bit index, the number of flags declared before
|
|
@@ -57,19 +64,10 @@ class KeeFlag:
|
|
|
57
64
|
__pos_args__ = None
|
|
58
65
|
__key_args__ = None
|
|
59
66
|
|
|
60
|
-
# Public Variables
|
|
61
|
-
fieldName: Field[str] = Field()
|
|
62
|
-
fieldOwner: Field[type] = Field()
|
|
63
|
-
index: Field[int] = Field()
|
|
64
|
-
name: Field[str] = Field()
|
|
65
|
-
args: Field[tuple] = Field()
|
|
66
|
-
kwargs: Field[dict] = Field()
|
|
67
|
-
|
|
68
67
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
69
68
|
# GETTERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
70
69
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
71
70
|
|
|
72
|
-
@fieldName.GET
|
|
73
71
|
def _getFieldName(self, ) -> str:
|
|
74
72
|
if self.__field_name__ is None:
|
|
75
73
|
raise MissingVariable(self, '__field_name__', str)
|
|
@@ -77,7 +75,6 @@ class KeeFlag:
|
|
|
77
75
|
return self.__field_name__
|
|
78
76
|
raise TypeException('__field_name__', self.__field_name__, str)
|
|
79
77
|
|
|
80
|
-
@fieldOwner.GET
|
|
81
78
|
def _getFieldOwner(self, ) -> type:
|
|
82
79
|
if self.__field_owner__ is None:
|
|
83
80
|
from . import KeeFlagsMeta
|
|
@@ -88,7 +85,6 @@ class KeeFlag:
|
|
|
88
85
|
from . import KeeFlagsMeta
|
|
89
86
|
raise TypeException(name, value, KeeFlagsMeta)
|
|
90
87
|
|
|
91
|
-
@index.GET
|
|
92
88
|
def _getIndex(self, ) -> int:
|
|
93
89
|
if self.__member_index__ is None:
|
|
94
90
|
raise MissingVariable(self, '__member_index__', int)
|
|
@@ -96,7 +92,6 @@ class KeeFlag:
|
|
|
96
92
|
return self.__member_index__
|
|
97
93
|
raise TypeException('__member_index__', self.__member_index__, int)
|
|
98
94
|
|
|
99
|
-
@name.GET
|
|
100
95
|
def _getName(self, ) -> str:
|
|
101
96
|
if self.__member_name__ is None:
|
|
102
97
|
raise MissingVariable(self, '__member_name__', str)
|
|
@@ -104,14 +99,19 @@ class KeeFlag:
|
|
|
104
99
|
return self.__member_name__
|
|
105
100
|
raise TypeException('__member_name__', self.__member_name__, str)
|
|
106
101
|
|
|
107
|
-
@args.GET
|
|
108
102
|
def _getArgs(self, ) -> Tuple[Any, ...]:
|
|
109
103
|
return maybe(self.__pos_args__, ())
|
|
110
104
|
|
|
111
|
-
@kwargs.GET
|
|
112
105
|
def _getKwargs(self, ) -> dict[str, Any]:
|
|
113
106
|
return maybe(self.__key_args__, {})
|
|
114
107
|
|
|
108
|
+
fieldName = property(_getFieldName)
|
|
109
|
+
fieldOwner = property(_getFieldOwner)
|
|
110
|
+
index = property(_getIndex)
|
|
111
|
+
name = property(_getName)
|
|
112
|
+
args = property(_getArgs)
|
|
113
|
+
kwargs = property(_getKwargs)
|
|
114
|
+
|
|
115
115
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
116
116
|
# Python API # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
117
117
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
@@ -181,6 +181,9 @@ class KeeFlag:
|
|
|
181
181
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
182
182
|
|
|
183
183
|
def __init__(self, *args, **kwargs) -> None:
|
|
184
|
+
info = """Declare the flag with 'Kee' instead, as 'READ =
|
|
185
|
+
Kee[str]()'."""
|
|
186
|
+
DeprecatedPromise(KeeFlag, textFmt(info)).warn()
|
|
184
187
|
self.__pos_args__ = args
|
|
185
188
|
self.__key_args__ = kwargs
|
|
186
189
|
|
|
@@ -190,8 +193,9 @@ class KeeFlag:
|
|
|
190
193
|
carrying over its constructor arguments, name, and index (the index
|
|
191
194
|
overridable via the argument).
|
|
192
195
|
"""
|
|
193
|
-
|
|
194
|
-
cloned =
|
|
196
|
+
cloned = object.__new__(type(self))
|
|
197
|
+
cloned.__pos_args__ = self.__pos_args__
|
|
198
|
+
cloned.__key_args__ = self.__key_args__
|
|
195
199
|
cloned.__field_owner__ = owner
|
|
196
200
|
cloned.__field_name__ = self.__field_name__
|
|
197
201
|
cloned.__member_index__ = maybe(index, self.__member_index__)
|
|
@@ -203,14 +207,14 @@ class KeeFlag:
|
|
|
203
207
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
204
208
|
|
|
205
209
|
if TYPE_CHECKING: # pragma: no cover, no mutate
|
|
206
|
-
@typing.overload
|
|
210
|
+
@typing.overload # pragma: no mutate
|
|
207
211
|
def __or__(self, other: Self) -> Self: ...
|
|
208
212
|
|
|
209
|
-
@typing.overload
|
|
213
|
+
@typing.overload # pragma: no mutate
|
|
210
214
|
def __and__(self, other: Self) -> Self: ...
|
|
211
215
|
|
|
212
|
-
@typing.overload
|
|
216
|
+
@typing.overload # pragma: no mutate
|
|
213
217
|
def __xor__(self, other: Self) -> Self: ...
|
|
214
218
|
|
|
215
|
-
@typing.overload
|
|
219
|
+
@typing.overload # pragma: no mutate
|
|
216
220
|
def __invert__(self) -> Self: ...
|