worktoy 1.2.2.dev0__tar.gz → 1.2.3__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.2.2.dev0 → worktoy-1.2.3}/PKG-INFO +3 -3
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/README.md +2 -2
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/pyproject.toml +1 -1
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/__init__.py +1 -1
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/dispatch/_dispatcher.py +216 -12
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/dispatch/_overload.py +41 -9
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/mcls/_base_space.py +391 -79
- worktoy-1.2.3/src/worktoy/mcls/space_hooks/_load_space_hook.py +434 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/__init__.py +2 -2
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_mixed_method_kind.py +15 -19
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy.egg-info/PKG-INFO +3 -3
- worktoy-1.2.2.dev0/src/worktoy/mcls/space_hooks/_load_space_hook.py +0 -228
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/LICENSE +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/setup.cfg +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/_instance_owner.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/_meta_type.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/_object.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/control_flow/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/control_flow/_control_flow.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/control_flow/_control_space.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/control_flow/_meta_flow.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/control_flow/_skip_set.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/sentinels/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/sentinels/_args.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/sentinels/_deleted.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/sentinels/_desc.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/sentinels/_meta_call.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/sentinels/_owner.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/sentinels/_sentinel.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/core/sentinels/_this.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/desc/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/desc/_alias.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/desc/_attri_box.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/desc/_base_descriptor.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/desc/_fast_box.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/desc/_field.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/desc/_fix_box.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/desc/_root_alias.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/desc/_symbolic_name.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/dispatch/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/dispatch/_call_me_maybe.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/dispatch/_flex_call.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/dispatch/_permuter.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/dispatch/_permuter_method.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/dispatch/_type_sig.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/ezdata/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/ezdata/_ez_data.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/ezdata/_ez_field.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/ezdata/_ez_hook.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/ezdata/_ez_meta.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/ezdata/_ez_space.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/ezdata/_ez_store.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/ezdata/_fields.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/_access_num.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/_kee_box.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/_kee_flag.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/_kee_flags.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/_kee_flags_hook.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/_kee_flags_meta.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/_kee_flags_space.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/_kee_member.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/_kee_meta.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/_kee_meta_meta.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/_kee_num.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/_kee_space.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/keenum/_kee_space_hook.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/lorem_ipsum/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/lorem_ipsum/_base_generator.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/lorem_ipsum/_clause.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/lorem_ipsum/_gaussian_lengths.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/lorem_ipsum/_paragraph.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/lorem_ipsum/_sentence.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/lorem_ipsum/_stochastic_variable.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/lorem_ipsum/_stochastic_word.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/lorem_ipsum/_words.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/mcls/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/mcls/_abstract_metaclass.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/mcls/_abstract_namespace.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/mcls/_base_meta.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/mcls/_base_object.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/mcls/space_hooks/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/mcls/space_hooks/_abstract_space_hook.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/mcls/space_hooks/_flex_call_hook.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/mcls/space_hooks/_name_hook.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/mcls/space_hooks/_reserved_names.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/mcls/space_hooks/_reserved_namespace_hook.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/mcls/space_hooks/_space_desc.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/py.typed +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_args_count.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_bipartite_matching.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_class_body_template.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_directory.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_exception_info.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_join_words.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_maybe.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_quick_desc.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_replace_flex.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_resolve_mro.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_slice_len.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_string_list.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_text_fmt.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_type_cast.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_unpack.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_valid_slice.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/_word_wrap.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/combinatorics/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/combinatorics/_arrangement.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/combinatorics/_arrangements.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/utilities/combinatorics/_index_permutations.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/_alternative_warning.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/_deprecated_promise.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/_missing_variable.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/_redundant_keyword.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/_risk_warning.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/_subclass_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/_type_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/_uncheckable_type.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/_unpack_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/_variable_not_none.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/_work_toy_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/_work_toy_warning.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/control_flow/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_access_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_dangling_alias.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_descriptor_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_missing_instance_dict.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_nameless_callback.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_not_a_descriptor.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_overload_reference.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_phantom_box_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_protected_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_read_only_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_recursive_read.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_reference_conflict.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_shared_descriptor.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_without_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/desc/_write_once_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/dispatch/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/dispatch/_bare_overload.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/dispatch/_dispatch_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/dispatch/_duplicate_signature.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/dispatch/_type_cast_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/dispatch/_unbound_cast_hook.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/ezdata/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/ezdata/_class_field_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/ezdata/_duplicate_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/ezdata/_extra_keyword_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/ezdata/_extra_positional_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/ezdata/_incomplete_field_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/ezdata/_kw_only_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/ezdata/_repeated_field_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/ezdata/_reserved_attribute_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/ezdata/_reserved_field_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/ezdata/_reserved_method_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/keenum/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/keenum/_kee_box_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/keenum/_kee_box_type_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/keenum/_kee_box_value_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/keenum/_kee_case_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/keenum/_kee_duplicate.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/keenum/_kee_flag_duplicate.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/keenum/_kee_flag_name_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/keenum/_kee_member_name_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/keenum/_kee_name_conflict.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/keenum/_kee_resolve_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/keenum/_kee_type_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/keenum/_kee_write_once_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_claimed_name.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_control_class_error.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_del_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_duplicate_hook.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_duplicate_sentinel.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_hook_exception.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_illegal_instantiation.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_overload_conflict.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_questionable_syntax.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_rebound_overload.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_reserved_name.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_shadowed_class_hook.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_slots_refused.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/waitaminute/meta/_unbound_class_hook.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/_base_test.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/_complex_mixin.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/_complex_test.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/_sub_test.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/_test_meta.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/_test_space.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/samplers/__init__.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/samplers/_base_sampler.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/samplers/_float_sampler.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/samplers/_gaussian_sampler.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/samplers/_int_sampler.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/samplers/_lorem_sampler.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/samplers/_lorem_text.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/samplers/_sampler_meta.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/samplers/_symbolic_sampler.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy/work_test/samplers/_word_sampler.py +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy.egg-info/SOURCES.txt +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy.egg-info/dependency_links.txt +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/src/worktoy.egg-info/top_level.txt +0 -0
- {worktoy-1.2.2.dev0 → worktoy-1.2.3}/tests/test_smoke.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: worktoy
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.3
|
|
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
|
|
@@ -27,12 +27,12 @@ License-File: LICENSE
|
|
|
27
27
|
Dynamic: license-file
|
|
28
28
|
|
|
29
29
|
[](https://wakatime.com/badge/github/AsgerJon/WorkToy)
|
|
30
|
-
[](https://claude.com/claude-code)
|
|
31
31
|
[](https://codecov.io/gh/AsgerJon/WorkToy)
|
|
32
32
|
[](https://pypi.org/project/worktoy/)
|
|
33
33
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
34
34
|
|
|
35
|
-
# worktoy v1.2.
|
|
35
|
+
# worktoy v1.2.3
|
|
36
36
|
|
|
37
37
|
**worktoy** provides utilities for Python development focused on
|
|
38
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.2.
|
|
7
|
+
# worktoy v1.2.3
|
|
8
8
|
|
|
9
9
|
**worktoy** provides utilities for Python development focused on
|
|
10
10
|
reducing boilerplate while improving type safety and readability. Each
|
|
@@ -63,6 +63,40 @@ def _dropReceiver(func: Method) -> Method:
|
|
|
63
63
|
return dropped
|
|
64
64
|
|
|
65
65
|
|
|
66
|
+
def _passClass(func: Method) -> Method:
|
|
67
|
+
"""
|
|
68
|
+
A dispatcher reached through an instance passes that instance ahead of
|
|
69
|
+
the arguments of every call. A classmethod at a name that also holds
|
|
70
|
+
bound methods is reached that way too, and must receive the class of
|
|
71
|
+
the instance, as a classmethod read through an instance does.
|
|
72
|
+
|
|
73
|
+
Implementation
|
|
74
|
+
--------------
|
|
75
|
+
|
|
76
|
+
The wrapper takes the instance by position and calls the function with
|
|
77
|
+
its class in that place; 'functools.wraps' copies the name, docstring
|
|
78
|
+
and attributes.
|
|
79
|
+
|
|
80
|
+
Parameters
|
|
81
|
+
----------
|
|
82
|
+
|
|
83
|
+
func : Method
|
|
84
|
+
A 'Callable[..., Any]' taking the class first.
|
|
85
|
+
|
|
86
|
+
Returns
|
|
87
|
+
-------
|
|
88
|
+
|
|
89
|
+
Method
|
|
90
|
+
A function taking the instance first and passing on its class.
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
@wraps(func)
|
|
94
|
+
def classed(receiver: Any, *args, **kwargs) -> Any:
|
|
95
|
+
return func(type(receiver), *args, **kwargs)
|
|
96
|
+
|
|
97
|
+
return classed
|
|
98
|
+
|
|
99
|
+
|
|
66
100
|
def _uniformType(types: tuple) -> Optional[type]:
|
|
67
101
|
first = types[0]
|
|
68
102
|
for type_ in types:
|
|
@@ -260,6 +294,25 @@ class Dispatcher(Object):
|
|
|
260
294
|
function, the fallback and the finalizer behind '_dropReceiver', and a
|
|
261
295
|
'PermuterMethod' over the wrapped function.
|
|
262
296
|
|
|
297
|
+
One name may hold bound methods, classmethods and staticmethods
|
|
298
|
+
together. A dispatcher still binds one receiver, the instance or the
|
|
299
|
+
class, and 'setFunctionKind' names the functions of another kind than
|
|
300
|
+
its own: a staticmethod is registered behind '_dropReceiver', and a
|
|
301
|
+
classmethod in a dispatcher of bound methods behind '_passClass'. A
|
|
302
|
+
name holding bound methods beside another kind takes two dispatchers.
|
|
303
|
+
The one in the class dictionary holds the bound methods and the
|
|
304
|
+
classmethods, and is reached through an instance. It keeps the second,
|
|
305
|
+
given by 'setClassDispatcher', which holds the classmethods and the
|
|
306
|
+
staticmethods, and hands a read through the class on to it. A bound
|
|
307
|
+
method is therefore not considered through the class, nor a
|
|
308
|
+
staticmethod through an instance. Where no overload of the name is a
|
|
309
|
+
bound method, only its fallback or its finalizer, the first holds the
|
|
310
|
+
staticmethods as well, so a fallback takes no call away from an
|
|
311
|
+
overload. Each of the two holds a fallback of
|
|
312
|
+
its own: the one reached through an instance the instance bound
|
|
313
|
+
fallback of the name, and the one reached through the class its class
|
|
314
|
+
bound fallback.
|
|
315
|
+
|
|
263
316
|
Attributes
|
|
264
317
|
----------
|
|
265
318
|
|
|
@@ -293,6 +346,13 @@ class Dispatcher(Object):
|
|
|
293
346
|
__method_kind__ = None
|
|
294
347
|
# The '_dropReceiver' wrapper of each function, for a staticmethod.
|
|
295
348
|
__static_adapters__ = None
|
|
349
|
+
# The '_passClass' wrapper of each function, for a classmethod reached
|
|
350
|
+
# through an instance.
|
|
351
|
+
__class_adapters__ = None
|
|
352
|
+
# The functions of another kind than the dispatcher, each with its kind.
|
|
353
|
+
__function_kinds__ = None
|
|
354
|
+
# The dispatcher a read through the class is handed on to.
|
|
355
|
+
__class_dispatcher__ = None
|
|
296
356
|
|
|
297
357
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
298
358
|
# GETTERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
@@ -564,6 +624,26 @@ class Dispatcher(Object):
|
|
|
564
624
|
"""
|
|
565
625
|
return self.__method_kind__
|
|
566
626
|
|
|
627
|
+
def _getFunctionKind(self, func: Any) -> Any:
|
|
628
|
+
for held, kind in maybe(self.__function_kinds__, []):
|
|
629
|
+
if held is func:
|
|
630
|
+
return kind
|
|
631
|
+
return self.__method_kind__
|
|
632
|
+
|
|
633
|
+
def getClassDispatcher(self) -> Optional[Self]:
|
|
634
|
+
"""
|
|
635
|
+
Code holding the dispatcher of a name with bound methods beside
|
|
636
|
+
another kind may need the dispatcher that answers through the class.
|
|
637
|
+
|
|
638
|
+
Returns
|
|
639
|
+
-------
|
|
640
|
+
|
|
641
|
+
Dispatcher or None
|
|
642
|
+
The dispatcher a read through the class is handed on to, or 'None'
|
|
643
|
+
when this dispatcher answers such a read itself.
|
|
644
|
+
"""
|
|
645
|
+
return self.__class_dispatcher__
|
|
646
|
+
|
|
567
647
|
def _hasRegistrations(self) -> bool:
|
|
568
648
|
registries = (
|
|
569
649
|
self._getSigFuncList(),
|
|
@@ -943,22 +1023,93 @@ class Dispatcher(Object):
|
|
|
943
1023
|
self.__method_kind__ = kind
|
|
944
1024
|
self.__compiled_func__ = None
|
|
945
1025
|
|
|
1026
|
+
def setFunctionKind(self, kind: Any, *funcs) -> None:
|
|
1027
|
+
"""
|
|
1028
|
+
One name may hold bound methods, classmethods and staticmethods
|
|
1029
|
+
together, while a dispatcher binds one receiver for every call. The
|
|
1030
|
+
functions of another kind than the dispatcher must be named before
|
|
1031
|
+
they are registered, since a function is wrapped for its kind as it
|
|
1032
|
+
is registered.
|
|
1033
|
+
|
|
1034
|
+
Implementation
|
|
1035
|
+
--------------
|
|
1036
|
+
|
|
1037
|
+
Each function is recorded with the kind, as it will be registered, a
|
|
1038
|
+
'PermuterMethod' of a flexible declaration included, and found again
|
|
1039
|
+
by identity. The compiled dispatch function is cleared.
|
|
1040
|
+
|
|
1041
|
+
Parameters
|
|
1042
|
+
----------
|
|
1043
|
+
|
|
1044
|
+
kind : Any
|
|
1045
|
+
'classmethod' or 'staticmethod'.
|
|
1046
|
+
|
|
1047
|
+
*funcs
|
|
1048
|
+
The functions of that kind.
|
|
1049
|
+
|
|
1050
|
+
Raises
|
|
1051
|
+
------
|
|
1052
|
+
|
|
1053
|
+
TypeError
|
|
1054
|
+
'kind' is neither of the two.
|
|
1055
|
+
|
|
1056
|
+
WriteOnceError
|
|
1057
|
+
A function, a fallback or a finalizer is registered already.
|
|
1058
|
+
"""
|
|
1059
|
+
if kind is not classmethod and kind is not staticmethod:
|
|
1060
|
+
infoSpec = """The kind of a function named apart from its
|
|
1061
|
+
dispatcher is 'classmethod' or 'staticmethod', not '%s'."""
|
|
1062
|
+
raise TypeError(textFmt(infoSpec % (kind,)))
|
|
1063
|
+
existing = maybe(self.__function_kinds__, [])
|
|
1064
|
+
if self._hasRegistrations():
|
|
1065
|
+
raise WriteOnceError(self, existing, (kind, *funcs))
|
|
1066
|
+
self.__function_kinds__ = [*existing, *((func, kind) for func in funcs)]
|
|
1067
|
+
self.__compiled_func__ = None
|
|
1068
|
+
|
|
1069
|
+
def setClassDispatcher(self, dispatcher: Self) -> None:
|
|
1070
|
+
"""
|
|
1071
|
+
A name holding bound methods beside classmethods or staticmethods is
|
|
1072
|
+
two things: through an instance it is the bound methods and the
|
|
1073
|
+
classmethods, through the class the classmethods and the
|
|
1074
|
+
staticmethods. Each is a dispatcher of its own, and the one the class
|
|
1075
|
+
holds must know the other.
|
|
1076
|
+
|
|
1077
|
+
Parameters
|
|
1078
|
+
----------
|
|
1079
|
+
|
|
1080
|
+
dispatcher : Dispatcher
|
|
1081
|
+
The dispatcher a read through the class is handed on to.
|
|
1082
|
+
|
|
1083
|
+
Raises
|
|
1084
|
+
------
|
|
1085
|
+
|
|
1086
|
+
TypeException
|
|
1087
|
+
'dispatcher' is not a 'Dispatcher'.
|
|
1088
|
+
"""
|
|
1089
|
+
if not isinstance(dispatcher, Dispatcher):
|
|
1090
|
+
raise TypeException('dispatcher', dispatcher, Dispatcher)
|
|
1091
|
+
self.__class_dispatcher__ = dispatcher
|
|
1092
|
+
|
|
946
1093
|
def _adaptToKind(self, func: Method) -> Method:
|
|
947
1094
|
"""
|
|
948
1095
|
The dispatch function passes a receiver ahead of the arguments of every
|
|
949
|
-
call,
|
|
950
|
-
|
|
1096
|
+
call: the instance, or the class for a dispatcher standing for a
|
|
1097
|
+
classmethod or a staticmethod. A staticmethod takes none, so it must
|
|
1098
|
+
be called without it, and a classmethod in a dispatcher of bound
|
|
1099
|
+
methods must be given the class of the instance. A function
|
|
951
1100
|
registered under several signatures must still be one function to the
|
|
952
1101
|
checks comparing registrations.
|
|
953
1102
|
|
|
954
1103
|
Implementation
|
|
955
1104
|
--------------
|
|
956
1105
|
|
|
957
|
-
|
|
958
|
-
|
|
1106
|
+
The kind of a function is the one 'setFunctionKind' named for it, or
|
|
1107
|
+
else that of the dispatcher. A staticmethod is wrapped by
|
|
1108
|
+
'_dropReceiver', and a classmethod in a dispatcher of bound methods
|
|
1109
|
+
by '_passClass', each wrapper kept under the function; a
|
|
959
1110
|
'PermuterMethod' is rebuilt over the wrapped function with the same
|
|
960
1111
|
arrangement, so it still reorders the arguments after the receiver.
|
|
961
|
-
|
|
1112
|
+
Any other function is returned as it is.
|
|
962
1113
|
|
|
963
1114
|
Parameters
|
|
964
1115
|
----------
|
|
@@ -972,11 +1123,21 @@ class Dispatcher(Object):
|
|
|
972
1123
|
Method
|
|
973
1124
|
What the dispatcher registers.
|
|
974
1125
|
"""
|
|
975
|
-
|
|
1126
|
+
kind = self._getFunctionKind(func)
|
|
1127
|
+
if kind is staticmethod:
|
|
1128
|
+
wrap = self._dropFor
|
|
1129
|
+
elif kind is classmethod and self.__method_kind__ is None:
|
|
1130
|
+
wrap = self._classFor
|
|
1131
|
+
else:
|
|
1132
|
+
# This branch is reached by the following:
|
|
1133
|
+
# - A bound method
|
|
1134
|
+
# - A classmethod in a dispatcher that binds the class
|
|
976
1135
|
return func
|
|
977
1136
|
if isinstance(func, PermuterMethod):
|
|
978
|
-
|
|
979
|
-
|
|
1137
|
+
return PermuterMethod(wrap(func.__wrapped__), func.arrangement)
|
|
1138
|
+
return wrap(func)
|
|
1139
|
+
|
|
1140
|
+
def _dropFor(self, func: Method) -> Method:
|
|
980
1141
|
adapters = self.__static_adapters__
|
|
981
1142
|
if adapters is None:
|
|
982
1143
|
adapters = dict()
|
|
@@ -990,6 +1151,20 @@ class Dispatcher(Object):
|
|
|
990
1151
|
adapters[func] = adapted
|
|
991
1152
|
return adapted
|
|
992
1153
|
|
|
1154
|
+
def _classFor(self, func: Method) -> Method:
|
|
1155
|
+
adapters = self.__class_adapters__
|
|
1156
|
+
if adapters is None:
|
|
1157
|
+
adapters = dict()
|
|
1158
|
+
self.__class_adapters__ = adapters
|
|
1159
|
+
try:
|
|
1160
|
+
adapted = adapters[func]
|
|
1161
|
+
except KeyError:
|
|
1162
|
+
# This branch is reached by the following:
|
|
1163
|
+
# - The first registration of the function on this dispatcher
|
|
1164
|
+
adapted = _passClass(func)
|
|
1165
|
+
adapters[func] = adapted
|
|
1166
|
+
return adapted
|
|
1167
|
+
|
|
993
1168
|
def addSigFunc(
|
|
994
1169
|
self,
|
|
995
1170
|
sig: TypeSig,
|
|
@@ -1165,6 +1340,15 @@ class Dispatcher(Object):
|
|
|
1165
1340
|
A call that no signature accepts, by class, by length or by cast, may
|
|
1166
1341
|
need a function of its own instead of an error.
|
|
1167
1342
|
|
|
1343
|
+
Implementation
|
|
1344
|
+
--------------
|
|
1345
|
+
|
|
1346
|
+
A dispatcher holds one fallback. A name holding bound methods beside
|
|
1347
|
+
another kind has two dispatchers and so two fallbacks, apart: the
|
|
1348
|
+
dispatcher reached through an instance holds the instance bound
|
|
1349
|
+
fallback, and the one reached through the class the class bound
|
|
1350
|
+
fallback.
|
|
1351
|
+
|
|
1168
1352
|
Parameters
|
|
1169
1353
|
----------
|
|
1170
1354
|
|
|
@@ -1254,8 +1438,9 @@ class Dispatcher(Object):
|
|
|
1254
1438
|
Through the class the compiled function is returned, through an
|
|
1255
1439
|
instance a new 'MethodType' of it on every read. A classmethod or a
|
|
1256
1440
|
staticmethod gives a new 'MethodType' bound to the class, read through
|
|
1257
|
-
either. A dispatcher
|
|
1258
|
-
|
|
1441
|
+
either. A dispatcher keeping a second one for the class hands a read
|
|
1442
|
+
through the class on to it. A dispatcher no class body placed, as one
|
|
1443
|
+
installed with 'setattr', has no name to compile with.
|
|
1259
1444
|
|
|
1260
1445
|
Parameters
|
|
1261
1446
|
----------
|
|
@@ -1282,9 +1467,16 @@ class Dispatcher(Object):
|
|
|
1282
1467
|
owner = type(instance)
|
|
1283
1468
|
if self.__method_kind__ is not None:
|
|
1284
1469
|
return MethodType(self._getCachedFunction(), owner)
|
|
1285
|
-
if instance is None:
|
|
1470
|
+
if instance is not None:
|
|
1471
|
+
return MethodType(self._getCachedFunction(), instance)
|
|
1472
|
+
onClass = self.__class_dispatcher__
|
|
1473
|
+
if onClass is None:
|
|
1474
|
+
# This branch is reached by the following:
|
|
1475
|
+
# - Every function at the name is a bound method
|
|
1286
1476
|
return self._getCachedFunction()
|
|
1287
|
-
|
|
1477
|
+
# The rest of the method is reached by the following:
|
|
1478
|
+
# - The name holds bound methods beside classmethods or staticmethods
|
|
1479
|
+
return onClass.__get__(None, owner)
|
|
1288
1480
|
|
|
1289
1481
|
def __set__(self, instance: Any, value: Any, **kwargs) -> Never:
|
|
1290
1482
|
"""
|
|
@@ -1334,6 +1526,10 @@ class Dispatcher(Object):
|
|
|
1334
1526
|
"""
|
|
1335
1527
|
self.swapAllTHIS(owner)
|
|
1336
1528
|
Object.__set_name__(self, owner, name, **kwargs)
|
|
1529
|
+
onClass = self.__class_dispatcher__
|
|
1530
|
+
if onClass is not None:
|
|
1531
|
+
# The dispatcher answering through the class is placed with this one.
|
|
1532
|
+
onClass.__set_name__(owner, name, **kwargs)
|
|
1337
1533
|
|
|
1338
1534
|
def __str__(self, ) -> str:
|
|
1339
1535
|
owner = self.getFieldOwner()
|
|
@@ -1426,6 +1622,11 @@ class Dispatcher(Object):
|
|
|
1426
1622
|
newLoad.__method_kind__ = self.__method_kind__
|
|
1427
1623
|
# The wrappers of a staticmethod stay one per function on the copy.
|
|
1428
1624
|
newLoad.__static_adapters__ = self.__static_adapters__
|
|
1625
|
+
newLoad.__class_adapters__ = self.__class_adapters__
|
|
1626
|
+
newLoad.__function_kinds__ = self.__function_kinds__
|
|
1627
|
+
onClass = self.__class_dispatcher__
|
|
1628
|
+
if onClass is not None:
|
|
1629
|
+
newLoad.__class_dispatcher__ = onClass.clone()
|
|
1429
1630
|
return newLoad
|
|
1430
1631
|
|
|
1431
1632
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
@@ -1452,6 +1653,9 @@ class Dispatcher(Object):
|
|
|
1452
1653
|
for sig, func in self._getVariadicFuncs():
|
|
1453
1654
|
sig.restoreTHIS()
|
|
1454
1655
|
self.__compiled_func__ = None
|
|
1656
|
+
onClass = self.__class_dispatcher__
|
|
1657
|
+
if onClass is not None:
|
|
1658
|
+
onClass.restoreTHIS()
|
|
1455
1659
|
|
|
1456
1660
|
def swapAllTHIS(self, thisType: type) -> None:
|
|
1457
1661
|
"""
|
|
@@ -71,14 +71,21 @@ class overload: # NOQA
|
|
|
71
71
|
raises 'MixedMethodKind'.
|
|
72
72
|
The namespace of a 'BaseObject' class claims every 'overload' object,
|
|
73
73
|
so the namespace never stores one, and 'LoadSpaceHook' builds the
|
|
74
|
-
'Dispatcher' of each name
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
'Dispatcher' of each name; see 'Dispatcher' for how calls are matched,
|
|
75
|
+
and for why the most specific signature is declared first. One name
|
|
76
|
+
may hold bound methods, classmethods and staticmethods together: the
|
|
77
|
+
classmethods and the staticmethods are reached through the class, the
|
|
78
|
+
bound methods and the classmethods through an instance, and a
|
|
79
|
+
staticmethod is not considered through an instance where the name has
|
|
80
|
+
a bound overload. The fallbacks of a name are two, apart: the instance
|
|
81
|
+
bound fallback, declared as a bound method, takes a call through an
|
|
82
|
+
instance that nothing accepts, and the class bound fallback, declared
|
|
83
|
+
as a staticmethod, takes such a call through the class; one declared
|
|
84
|
+
as a classmethod is both. A subclass declaring an overload at a name
|
|
85
|
+
it inherits keeps the inherited overloads and adds its own, an equal
|
|
86
|
+
signature replacing the inherited one. A subclass overloading the name
|
|
87
|
+
only as kinds of method the inherited declarations are not overrides
|
|
88
|
+
it as a plain definition does, hiding the inherited overloads.
|
|
82
89
|
"""
|
|
83
90
|
|
|
84
91
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
@@ -504,7 +511,32 @@ class overload: # NOQA
|
|
|
504
511
|
def fallback(cls, func) -> Self:
|
|
505
512
|
"""
|
|
506
513
|
A call no declaration of the name accepts may need a function of its
|
|
507
|
-
own instead of an error.
|
|
514
|
+
own instead of an error. A name holding bound methods beside
|
|
515
|
+
staticmethods is reached two ways, through an instance and through
|
|
516
|
+
the class, and may need such a function for each way.
|
|
517
|
+
|
|
518
|
+
Implementation
|
|
519
|
+
--------------
|
|
520
|
+
|
|
521
|
+
The function is recorded as a fallback of its name, as the kind of
|
|
522
|
+
method the stack declares it. The fallbacks of a name are two, apart:
|
|
523
|
+
|
|
524
|
+
- The instance bound fallback takes a call through an instance that
|
|
525
|
+
nothing accepts. A fallback declared as a bound method is instance
|
|
526
|
+
bound, and receives the instance.
|
|
527
|
+
- The class bound fallback takes such a call through the class. A
|
|
528
|
+
fallback declared as a staticmethod is class bound, and receives
|
|
529
|
+
the arguments alone.
|
|
530
|
+
|
|
531
|
+
A fallback declared as a classmethod is both at once, receiving the
|
|
532
|
+
class either way, so it stands alone at its name. A name may thus
|
|
533
|
+
hold one bound fallback and one static fallback, and any other two
|
|
534
|
+
are refused with 'DuplicateSignature' as the class body binds the
|
|
535
|
+
second. At a name holding no bound overload the staticmethods are
|
|
536
|
+
tried through an instance as well, and so is its class bound
|
|
537
|
+
fallback, unless the name has an instance bound fallback, which then
|
|
538
|
+
takes those calls. A fallback thus takes no call away from an
|
|
539
|
+
overload that accepts it.
|
|
508
540
|
|
|
509
541
|
Parameters
|
|
510
542
|
----------
|