worktoy 1.1.0.dev2__tar.gz → 1.1.0.dev4__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.0.dev2 → worktoy-1.1.0.dev4}/PKG-INFO +2 -2
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/README.md +1 -1
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/pyproject.toml +1 -1
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/__init__.py +1 -1
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/_object.py +127 -47
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/desc/_base_descriptor.py +3 -5
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/space_hooks/_abstract_space_hook.py +1 -4
- worktoy-1.1.0.dev4/src/worktoy/mcls/space_hooks/_space_desc.py +90 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy.egg-info/PKG-INFO +2 -2
- worktoy-1.1.0.dev2/src/worktoy/mcls/space_hooks/_space_desc.py +0 -46
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/LICENSE +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/setup.cfg +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/_instance_owner.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/_meta_type.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/control_flow/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/control_flow/_control_flow.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/control_flow/_control_space.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/control_flow/_meta_flow.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/control_flow/_skip_set.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/sentinels/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/sentinels/_args.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/sentinels/_deleted.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/sentinels/_desc.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/sentinels/_meta_call.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/sentinels/_owner.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/sentinels/_sentinel.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/core/sentinels/_this.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/desc/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/desc/_alias.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/desc/_attri_box.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/desc/_fast_box.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/desc/_field.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/desc/_fix_box.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/desc/_root_alias.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/desc/_symbolic_name.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/dispatch/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/dispatch/_call_me_maybe.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/dispatch/_dispatcher.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/dispatch/_flex_call.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/dispatch/_overload.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/dispatch/_permuter.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/dispatch/_permuter_method.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/dispatch/_type_sig.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/ezdata/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/ezdata/_ez_data.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/ezdata/_ez_field.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/ezdata/_ez_hook.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/ezdata/_ez_meta.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/ezdata/_ez_space.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/ezdata/_ez_store.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/ezdata/_fields.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/_access_num.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/_kee_box.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/_kee_flag.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/_kee_flags.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/_kee_flags_hook.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/_kee_flags_meta.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/_kee_flags_space.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/_kee_member.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/_kee_meta.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/_kee_meta_meta.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/_kee_num.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/_kee_space.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/keenum/_kee_space_hook.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/lorem_ipsum/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/lorem_ipsum/_base_generator.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/lorem_ipsum/_clause.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/lorem_ipsum/_gaussian_lengths.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/lorem_ipsum/_paragraph.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/lorem_ipsum/_sentence.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/lorem_ipsum/_stochastic_variable.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/lorem_ipsum/_stochastic_word.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/lorem_ipsum/_words.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/_abstract_metaclass.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/_abstract_namespace.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/_base_meta.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/_base_object.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/_base_space.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/space_hooks/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/space_hooks/_flex_call_hook.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/space_hooks/_load_space_hook.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/space_hooks/_name_hook.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/space_hooks/_reserved_names.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/space_hooks/_reserved_namespace_hook.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/py.typed +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_args_count.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_bipartite_matching.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_class_body_template.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_directory.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_exception_info.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_join_words.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_maybe.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_quick_desc.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_replace_flex.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_resolve_mro.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_slice_len.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_string_list.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_text_fmt.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_type_cast.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_unpack.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_valid_slice.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/_word_wrap.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/combinatorics/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/combinatorics/_arrangement.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/combinatorics/_arrangements.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/utilities/combinatorics/_index_permutations.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/_missing_variable.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/_subclass_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/_type_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/_uncheckable_type.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/_unpack_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/_variable_not_none.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/_work_toy_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/control_flow/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_access_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_dangling_alias.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_descriptor_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_missing_instance_dict.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_nameless_callback.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_not_a_descriptor.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_overload_reference.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_phantom_box_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_protected_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_read_only_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_recursive_read.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_reference_conflict.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_shared_descriptor.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_without_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/desc/_write_once_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/dispatch/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/dispatch/_bare_overload.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/dispatch/_dispatch_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/dispatch/_duplicate_signature.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/dispatch/_type_cast_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/dispatch/_unbound_cast_hook.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/ezdata/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/ezdata/_class_field_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/ezdata/_duplicate_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/ezdata/_extra_keyword_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/ezdata/_extra_positional_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/ezdata/_incomplete_field_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/ezdata/_kw_only_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/ezdata/_repeated_field_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/ezdata/_reserved_attribute_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/ezdata/_reserved_field_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/ezdata/_reserved_method_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/keenum/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/keenum/_kee_box_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/keenum/_kee_box_type_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/keenum/_kee_box_value_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/keenum/_kee_case_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/keenum/_kee_duplicate.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/keenum/_kee_flag_duplicate.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/keenum/_kee_flag_name_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/keenum/_kee_member_name_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/keenum/_kee_name_conflict.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/keenum/_kee_resolve_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/keenum/_kee_type_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/keenum/_kee_write_once_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_claimed_name.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_control_class_error.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_del_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_duplicate_hook.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_duplicate_sentinel.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_hook_exception.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_illegal_instantiation.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_mixed_method_kind.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_overload_conflict.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_questionable_syntax.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_rebound_overload.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_reserved_name.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_shadowed_class_hook.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_slots_refused.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/waitaminute/meta/_unbound_class_hook.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/_base_test.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/_complex_mixin.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/_complex_test.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/_sub_test.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/samplers/__init__.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/samplers/_base_sampler.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/samplers/_float_sampler.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/samplers/_gaussian_sampler.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/samplers/_int_sampler.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/samplers/_lorem_sampler.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/samplers/_lorem_text.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/samplers/_sampler_meta.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/samplers/_symbolic_sampler.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/work_test/samplers/_word_sampler.py +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy.egg-info/SOURCES.txt +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy.egg-info/dependency_links.txt +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy.egg-info/top_level.txt +0 -0
- {worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/tests/test_smoke.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: worktoy
|
|
3
|
-
Version: 1.1.0.
|
|
3
|
+
Version: 1.1.0.dev4
|
|
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: Apache-2.0
|
|
@@ -33,7 +33,7 @@ Dynamic: license-file
|
|
|
33
33
|
[](https://pypi.org/project/worktoy/)
|
|
34
34
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
35
35
|
|
|
36
|
-
# worktoy v1.1.0-
|
|
36
|
+
# worktoy v1.1.0-dev4 (development build)
|
|
37
37
|
|
|
38
38
|
**worktoy** provides utilities for Python development focused on
|
|
39
39
|
reducing boilerplate while improving type safety and readability. Each
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://pypi.org/project/worktoy/)
|
|
5
5
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
6
|
|
|
7
|
-
# worktoy v1.1.0-
|
|
7
|
+
# worktoy v1.1.0-dev4 (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
|
|
@@ -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.1.0-
|
|
51
|
+
__version__ = '1.1.0-dev4'
|
|
52
52
|
|
|
53
53
|
from . import utilities
|
|
54
54
|
from . import waitaminute
|
|
@@ -6,6 +6,7 @@ Object is the most primitive base class in the 'worktoy' library.
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
8
|
import re
|
|
9
|
+
from threading import local
|
|
9
10
|
from typing import TYPE_CHECKING
|
|
10
11
|
|
|
11
12
|
from ..utilities import Directory, maybe
|
|
@@ -25,6 +26,61 @@ if TYPE_CHECKING: # pragma: no cover, no mutate
|
|
|
25
26
|
# call.
|
|
26
27
|
_PRIVATE_KEY_PATTERN = re.compile(r'(?<!^)(?=[A-Z])')
|
|
27
28
|
|
|
29
|
+
class _ThreadRecords(local):
|
|
30
|
+
"""
|
|
31
|
+
The frames and the read-hook records of every descriptor, kept per
|
|
32
|
+
thread. Each mapping takes 'id(desc)' to '(desc, list)', the list being
|
|
33
|
+
changed in place, since no other thread ever reads it. A record is
|
|
34
|
+
dropped when its list empties. Every thread starts without records, on
|
|
35
|
+
every build and whatever the flag 'thread_inherit_context' says, and a
|
|
36
|
+
frame never outlives the call that pushed it, so an asyncio task
|
|
37
|
+
cannot see the frames of another.
|
|
38
|
+
|
|
39
|
+
Implementation
|
|
40
|
+
--------------
|
|
41
|
+
|
|
42
|
+
The key is 'id(desc)', and an 'id' is unique only among objects alive
|
|
43
|
+
at the same time: once a descriptor is gone, Python may hand its 'id'
|
|
44
|
+
to a new object. A record found under the 'id' of a new descriptor
|
|
45
|
+
would then be the frames of a dead one. That cannot happen here, and
|
|
46
|
+
the reason is the first element of the record. The record holds the
|
|
47
|
+
descriptor itself, so for as long as a record exists its descriptor is
|
|
48
|
+
alive and its 'id' is taken; the record is dropped the moment its
|
|
49
|
+
list empties, and with it the hold. A descriptor dropped by its owner
|
|
50
|
+
while a frame is still open keeps its 'id' until that frame is popped,
|
|
51
|
+
which the pairing of 'createContext' with 'exitContext' guarantees.
|
|
52
|
+
The held descriptor is read by nothing. An identity check against it
|
|
53
|
+
was carried at first and removed, since no input reaches it: the four
|
|
54
|
+
mutants turning it into an equality check all survived the sweep of
|
|
55
|
+
2026-11-07, which is what an unreachable branch looks like.
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
def __init__(self) -> None:
|
|
59
|
+
"""Give the thread empty mappings on its first use"""
|
|
60
|
+
self.chains: dict[int, tuple[Any, list]] = {}
|
|
61
|
+
self.locks: dict[int, tuple[Any, list]] = {}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
_THREAD = _ThreadRecords()
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _record(records: dict[int, tuple[Any, list]], desc: Any) -> list:
|
|
68
|
+
"""Return the list of 'desc' in 'records', or an empty one"""
|
|
69
|
+
entry: Optional[tuple[Any, list]] = records.get(id(desc))
|
|
70
|
+
if entry is None:
|
|
71
|
+
return []
|
|
72
|
+
return entry[1]
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _readCallChain(self: Any) -> list[tuple[Any, type]]:
|
|
76
|
+
"""Return a copy of the frames of 'self' in the current thread"""
|
|
77
|
+
return [*_record(_THREAD.chains, self)]
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _readGetLock(self: Any) -> list[tuple[Any, str]]:
|
|
81
|
+
"""Return a copy of the read-hook records of 'self' in this thread"""
|
|
82
|
+
return [*_record(_THREAD.locks, self)]
|
|
83
|
+
|
|
28
84
|
|
|
29
85
|
class Object(metaclass=MetaType):
|
|
30
86
|
"""
|
|
@@ -62,9 +118,10 @@ class Object(metaclass=MetaType):
|
|
|
62
118
|
left to the metaclass, as for 'type'. A deletion stores 'DELETED',
|
|
63
119
|
which a read turns into 'MissingVariable'. A read made while a read
|
|
64
120
|
hook of the same descriptor runs for the same instance is refused with
|
|
65
|
-
'RecursiveRead', since it would run that hook again. The frames
|
|
66
|
-
|
|
67
|
-
|
|
121
|
+
'RecursiveRead', since it would run that hook again. The frames and the
|
|
122
|
+
read-hook records live in thread-local storage, not on the descriptor,
|
|
123
|
+
so each thread keeps its own, and accesses through the same descriptor
|
|
124
|
+
from several threads do not see each other.
|
|
68
125
|
|
|
69
126
|
Attributes
|
|
70
127
|
----------
|
|
@@ -90,12 +147,13 @@ class Object(metaclass=MetaType):
|
|
|
90
147
|
__key_args__ : dict or None
|
|
91
148
|
The keyword arguments of the constructor.
|
|
92
149
|
|
|
93
|
-
__call_chain__ : list
|
|
94
|
-
|
|
150
|
+
__call_chain__ : list
|
|
151
|
+
A copy of the stack of '(instance, owner)' frames in the current
|
|
152
|
+
thread.
|
|
95
153
|
|
|
96
|
-
__get_lock__ : list
|
|
97
|
-
|
|
98
|
-
the hook, 'preGet' or 'onGet'.
|
|
154
|
+
__get_lock__ : list
|
|
155
|
+
A copy of the instances whose read hooks are running in the current
|
|
156
|
+
thread, each with the name of the hook, 'preGet' or 'onGet'.
|
|
99
157
|
|
|
100
158
|
Examples
|
|
101
159
|
--------
|
|
@@ -124,14 +182,16 @@ class Object(metaclass=MetaType):
|
|
|
124
182
|
__private_name__: Optional[str] = None # cached result of 'getPrivateName'
|
|
125
183
|
__pos_args__: Optional[tuple[Any, ...]] = None
|
|
126
184
|
__key_args__: Optional[dict[str, Any]] = None
|
|
127
|
-
__call_chain__: Optional[list[tuple[Any, type]]] = None
|
|
128
|
-
__get_lock__: Optional[list[tuple[Any, str]]] = None
|
|
129
185
|
|
|
130
186
|
# Public Variables
|
|
131
187
|
directory = Directory()
|
|
132
188
|
instance = ContextInstance()
|
|
133
189
|
owner = ContextOwner()
|
|
134
190
|
|
|
191
|
+
# Virtual Variables
|
|
192
|
+
__call_chain__ = property(_readCallChain)
|
|
193
|
+
__get_lock__ = property(_readGetLock)
|
|
194
|
+
|
|
135
195
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
136
196
|
# GETTERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
137
197
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
@@ -160,8 +220,9 @@ class Object(metaclass=MetaType):
|
|
|
160
220
|
dict[type[Sentinel], Any]
|
|
161
221
|
The mapping from each placeholder to its value.
|
|
162
222
|
"""
|
|
163
|
-
|
|
164
|
-
|
|
223
|
+
chain: list = _record(_THREAD.chains, self)
|
|
224
|
+
if chain:
|
|
225
|
+
instance, owner = chain[-1]
|
|
165
226
|
else:
|
|
166
227
|
instance, owner = None, None
|
|
167
228
|
return {
|
|
@@ -281,9 +342,10 @@ class Object(metaclass=MetaType):
|
|
|
281
342
|
of its box.
|
|
282
343
|
"""
|
|
283
344
|
if self.hasContext():
|
|
284
|
-
|
|
345
|
+
chain: list = _record(_THREAD.chains, self)
|
|
346
|
+
if not chain:
|
|
285
347
|
raise MissingVariable(self, '__call_chain__', list)
|
|
286
|
-
return
|
|
348
|
+
return chain[-1][0]
|
|
287
349
|
if self.__field_name__ is None:
|
|
288
350
|
infoSpec: str = """'%s' object has no attribute 'instance'"""
|
|
289
351
|
info: str = infoSpec % type(self).__name__
|
|
@@ -331,9 +393,10 @@ class Object(metaclass=MetaType):
|
|
|
331
393
|
of its box.
|
|
332
394
|
"""
|
|
333
395
|
if self.hasContext():
|
|
334
|
-
|
|
396
|
+
chain: list = _record(_THREAD.chains, self)
|
|
397
|
+
if not chain:
|
|
335
398
|
raise MissingVariable(self, '__call_chain__', list)
|
|
336
|
-
return
|
|
399
|
+
return chain[-1][1]
|
|
337
400
|
if self.__field_name__ is None:
|
|
338
401
|
infoSpec: str = """'%s' object has no attribute 'owner'"""
|
|
339
402
|
info: str = infoSpec % type(self).__name__
|
|
@@ -372,7 +435,7 @@ class Object(metaclass=MetaType):
|
|
|
372
435
|
bool
|
|
373
436
|
Whether a frame is on the stack.
|
|
374
437
|
"""
|
|
375
|
-
return bool(self
|
|
438
|
+
return bool(_record(_THREAD.chains, self))
|
|
376
439
|
|
|
377
440
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
378
441
|
# CONSTRUCTORS # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
@@ -388,16 +451,14 @@ class Object(metaclass=MetaType):
|
|
|
388
451
|
Implementation
|
|
389
452
|
--------------
|
|
390
453
|
|
|
391
|
-
The arguments
|
|
392
|
-
'
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
'getKeyArgs'.
|
|
454
|
+
The arguments are written with 'object.__setattr__', and the next
|
|
455
|
+
'__init__' along the resolution order is called without arguments. A
|
|
456
|
+
subclass taking arguments of its own passes on to this method the ones
|
|
457
|
+
meant for 'getPosArgs' and 'getKeyArgs'.
|
|
396
458
|
"""
|
|
397
459
|
# The bookkeeping bypasses any '__setattr__' of a subclass.
|
|
398
460
|
object.__setattr__(self, '__pos_args__', args)
|
|
399
461
|
object.__setattr__(self, '__key_args__', kwargs)
|
|
400
|
-
object.__setattr__(self, '__call_chain__', [])
|
|
401
462
|
# The arguments belong to this class, which recorded them above. A
|
|
402
463
|
# base after it in the resolution order, such as 'threading.Thread',
|
|
403
464
|
# is initialized without them, as in a plain class.
|
|
@@ -505,13 +566,14 @@ class Object(metaclass=MetaType):
|
|
|
505
566
|
Implementation
|
|
506
567
|
--------------
|
|
507
568
|
|
|
508
|
-
The instances whose read hooks are running
|
|
509
|
-
each with the name of its hook. An
|
|
510
|
-
with 'RecursiveRead', naming the hook
|
|
511
|
-
is added, the hook called, and the
|
|
512
|
-
block, so a hook raising leaves later
|
|
513
|
-
|
|
514
|
-
|
|
569
|
+
The instances whose read hooks are running in the current thread are
|
|
570
|
+
kept in the thread-local records, each with the name of its hook. An
|
|
571
|
+
instance found there is refused with 'RecursiveRead', naming the hook
|
|
572
|
+
that runs. Otherwise the instance is added, the hook called, and the
|
|
573
|
+
instance removed in a 'finally' block, so a hook raising leaves later
|
|
574
|
+
reads as they were. Hooks of one thread nest, so the instance removed
|
|
575
|
+
is always the last one added. A read of the same instance from another
|
|
576
|
+
thread has records of its own, and is not refused.
|
|
515
577
|
|
|
516
578
|
Parameters
|
|
517
579
|
----------
|
|
@@ -534,17 +596,24 @@ class Object(metaclass=MetaType):
|
|
|
534
596
|
RecursiveRead
|
|
535
597
|
A read hook of this descriptor runs for the instance already.
|
|
536
598
|
"""
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
599
|
+
records: dict[int, tuple[Any, list]] = _THREAD.locks
|
|
600
|
+
key: int = id(self)
|
|
601
|
+
entry: Optional[tuple[Any, list]] = records.get(key)
|
|
602
|
+
if entry is None:
|
|
603
|
+
entry = (self, [])
|
|
604
|
+
records[key] = entry
|
|
605
|
+
else:
|
|
606
|
+
for held, runningPhase in entry[1]:
|
|
607
|
+
if held is instance:
|
|
608
|
+
raise RecursiveRead(self, instance, runningPhase)
|
|
609
|
+
locked: list[tuple[Any, str]] = entry[1]
|
|
610
|
+
locked.append((instance, phase))
|
|
542
611
|
try:
|
|
543
612
|
hook(instance, *args)
|
|
544
613
|
finally:
|
|
545
|
-
locked
|
|
546
|
-
|
|
547
|
-
|
|
614
|
+
locked.pop()
|
|
615
|
+
if not locked:
|
|
616
|
+
del records[key]
|
|
548
617
|
|
|
549
618
|
def __set__(self, instance: Any, newValue: Any, **kwargs) -> None:
|
|
550
619
|
"""
|
|
@@ -766,8 +835,9 @@ class Object(metaclass=MetaType):
|
|
|
766
835
|
Implementation
|
|
767
836
|
--------------
|
|
768
837
|
|
|
769
|
-
The frame is appended to
|
|
770
|
-
|
|
838
|
+
The frame is appended to the stack of the current thread, which is
|
|
839
|
+
made when the descriptor has none. Every call is paired with one call
|
|
840
|
+
of 'exitContext', in a 'finally' block.
|
|
771
841
|
|
|
772
842
|
Parameters
|
|
773
843
|
----------
|
|
@@ -784,9 +854,13 @@ class Object(metaclass=MetaType):
|
|
|
784
854
|
Object
|
|
785
855
|
The descriptor itself.
|
|
786
856
|
"""
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
857
|
+
records: dict[int, tuple[Any, list]] = _THREAD.chains
|
|
858
|
+
key: int = id(self)
|
|
859
|
+
entry: Optional[tuple[Any, list]] = records.get(key)
|
|
860
|
+
if entry is None:
|
|
861
|
+
records[key] = (self, [(instance, owner)])
|
|
862
|
+
else:
|
|
863
|
+
entry[1].append((instance, owner))
|
|
790
864
|
return self
|
|
791
865
|
|
|
792
866
|
def exitContext(self) -> Self:
|
|
@@ -798,7 +872,8 @@ class Object(metaclass=MetaType):
|
|
|
798
872
|
Implementation
|
|
799
873
|
--------------
|
|
800
874
|
|
|
801
|
-
The stack
|
|
875
|
+
The top frame of the stack of the current thread is removed, and the
|
|
876
|
+
stack is dropped when it empties.
|
|
802
877
|
|
|
803
878
|
Returns
|
|
804
879
|
-------
|
|
@@ -812,10 +887,15 @@ class Object(metaclass=MetaType):
|
|
|
812
887
|
WithoutException
|
|
813
888
|
The stack is empty.
|
|
814
889
|
"""
|
|
815
|
-
|
|
890
|
+
records: dict[int, tuple[Any, list]] = _THREAD.chains
|
|
891
|
+
key: int = id(self)
|
|
892
|
+
entry: Optional[tuple[Any, list]] = records.get(key)
|
|
893
|
+
if entry is None:
|
|
816
894
|
raise WithoutException(self)
|
|
817
|
-
|
|
818
|
-
|
|
895
|
+
frames: list[tuple[Any, type]] = entry[1]
|
|
896
|
+
frames.pop()
|
|
897
|
+
if not frames:
|
|
898
|
+
del records[key]
|
|
819
899
|
return self
|
|
820
900
|
|
|
821
901
|
def _deletedGuard(self, instance: Any, value: Any, ) -> Any:
|
|
@@ -359,8 +359,9 @@ class BaseDescriptor(Object, Generic[T]):
|
|
|
359
359
|
--------------
|
|
360
360
|
|
|
361
361
|
The instance dictionary is copied field by field, except the owner,
|
|
362
|
-
the field name
|
|
363
|
-
|
|
362
|
+
the field name and '__private_name__'. The stack of frames and the
|
|
363
|
+
record of the read hooks running are kept per context outside the
|
|
364
|
+
descriptor, so the copy starts with neither. A subclass keeping a
|
|
364
365
|
cache built from the field name clears it when the copy is placed.
|
|
365
366
|
|
|
366
367
|
Returns
|
|
@@ -375,14 +376,11 @@ class BaseDescriptor(Object, Generic[T]):
|
|
|
375
376
|
'__field_owner__',
|
|
376
377
|
'__field_name__',
|
|
377
378
|
'__private_name__',
|
|
378
|
-
'__call_chain__',
|
|
379
|
-
'__get_lock__',
|
|
380
379
|
)
|
|
381
380
|
for key, value in vars(self).items():
|
|
382
381
|
if key in skipped:
|
|
383
382
|
continue
|
|
384
383
|
object.__setattr__(new, key, value)
|
|
385
|
-
object.__setattr__(new, '__call_chain__', [])
|
|
386
384
|
return new
|
|
387
385
|
|
|
388
386
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
{worktoy-1.1.0.dev2 → worktoy-1.1.0.dev4}/src/worktoy/mcls/space_hooks/_abstract_space_hook.py
RENAMED
|
@@ -70,9 +70,6 @@ class AbstractSpaceHook(Object):
|
|
|
70
70
|
# NAMESPACE # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
71
71
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
72
72
|
|
|
73
|
-
# Private variables
|
|
74
|
-
__space_object__: Optional[AbstractNamespace] = None
|
|
75
|
-
|
|
76
73
|
# Public variables
|
|
77
74
|
space: SpaceDesc[AbstractNamespace] = SpaceDesc()
|
|
78
75
|
|
|
@@ -279,5 +276,5 @@ class AbstractSpaceHook(Object):
|
|
|
279
276
|
"""
|
|
280
277
|
if instance is None:
|
|
281
278
|
return self
|
|
282
|
-
self.
|
|
279
|
+
self.space = instance
|
|
283
280
|
return self
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""
|
|
2
|
+
SpaceDesc is the descriptor exposing the namespace to an
|
|
3
|
+
'AbstractSpaceHook'.
|
|
4
|
+
"""
|
|
5
|
+
# Apache-2.0 license
|
|
6
|
+
# Copyright (c) 2025-2026 Asger Jon Vistisen
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import threading
|
|
10
|
+
from typing import TYPE_CHECKING, overload, Generic, TypeVar
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING: # pragma: no cover, no mutate
|
|
13
|
+
from typing import Any, Optional, Union, Self
|
|
14
|
+
|
|
15
|
+
from . import AbstractSpaceHook as Hook
|
|
16
|
+
|
|
17
|
+
NamespaceT = TypeVar('NamespaceT')
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class _ThreadSpaces(threading.local):
|
|
21
|
+
"""
|
|
22
|
+
The namespace each hook is bound to, kept per thread. A hook is one
|
|
23
|
+
object on its namespace class, shared by every class statement that
|
|
24
|
+
runs under that class, and the namespace reads it anew before every
|
|
25
|
+
phase, binding it to itself. Two threads running class statements at
|
|
26
|
+
once would otherwise bind the same hook in turn, and a phase of one
|
|
27
|
+
thread would read the namespace of the other, finding names it never
|
|
28
|
+
bound and registering overloads in a body not its own. Kept per
|
|
29
|
+
thread, a binding is seen only by the thread that made it.
|
|
30
|
+
|
|
31
|
+
Implementation
|
|
32
|
+
--------------
|
|
33
|
+
|
|
34
|
+
'bound' maps 'id(hook)' to '(hook, namespace)'. The hook is held in the
|
|
35
|
+
entry so that its 'id' stays taken for as long as the entry exists,
|
|
36
|
+
and a new hook can never find the namespace of a dead one under a
|
|
37
|
+
reused 'id'; nothing reads the held hook. Entries are replaced at every
|
|
38
|
+
binding and never dropped, as the binding on the hook itself was never
|
|
39
|
+
cleared before: a hook keeps the last namespace it worked for, per
|
|
40
|
+
thread now rather than once for all threads.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
def __init__(self) -> None:
|
|
44
|
+
"""Give the thread an empty mapping on its first use"""
|
|
45
|
+
self.bound: dict[int, tuple[Any, Any]] = {}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
_THREAD = _ThreadSpaces()
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class SpaceDesc(Generic[NamespaceT]):
|
|
52
|
+
"""
|
|
53
|
+
A hook method must reach the namespace whose class body it is working
|
|
54
|
+
on, and one hook object serves every namespace of its class, from
|
|
55
|
+
whichever thread a class statement runs in.
|
|
56
|
+
|
|
57
|
+
Implementation
|
|
58
|
+
--------------
|
|
59
|
+
|
|
60
|
+
Through a hook, the descriptor returns the namespace the hook was last
|
|
61
|
+
bound to in the current thread, or 'None' before any binding; through
|
|
62
|
+
the class, itself. A write through a hook binds it, in the current
|
|
63
|
+
thread alone.
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
# @formatter:off
|
|
67
|
+
@overload
|
|
68
|
+
def __get__(self, instance: None, owner: type) -> Self: ...
|
|
69
|
+
@overload
|
|
70
|
+
def __get__(self, instance: Hook, owner: type) -> NamespaceT: ...
|
|
71
|
+
# @formatter:on
|
|
72
|
+
|
|
73
|
+
def __get__(self, instance: Any, owner: type) -> Union[Self, NamespaceT]:
|
|
74
|
+
"""
|
|
75
|
+
Accessed on a hook instance, '__get__' returns the namespace bound to
|
|
76
|
+
that hook in the current thread; accessed on the class, it returns
|
|
77
|
+
the descriptor itself.
|
|
78
|
+
"""
|
|
79
|
+
if instance is None:
|
|
80
|
+
return self
|
|
81
|
+
entry: Optional[tuple[Any, Any]] = _THREAD.bound.get(id(instance))
|
|
82
|
+
if entry is None:
|
|
83
|
+
return None
|
|
84
|
+
return entry[1]
|
|
85
|
+
|
|
86
|
+
def __set__(self, instance: Hook, value: NamespaceT) -> None:
|
|
87
|
+
"""
|
|
88
|
+
A write binds the hook to the namespace, in the current thread.
|
|
89
|
+
"""
|
|
90
|
+
_THREAD.bound[id(instance)] = (instance, value)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: worktoy
|
|
3
|
-
Version: 1.1.0.
|
|
3
|
+
Version: 1.1.0.dev4
|
|
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: Apache-2.0
|
|
@@ -33,7 +33,7 @@ Dynamic: license-file
|
|
|
33
33
|
[](https://pypi.org/project/worktoy/)
|
|
34
34
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
35
35
|
|
|
36
|
-
# worktoy v1.1.0-
|
|
36
|
+
# worktoy v1.1.0-dev4 (development build)
|
|
37
37
|
|
|
38
38
|
**worktoy** provides utilities for Python development focused on
|
|
39
39
|
reducing boilerplate while improving type safety and readability. Each
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
SpaceDesc is the descriptor exposing the namespace to an
|
|
3
|
-
'AbstractSpaceHook'.
|
|
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, overload, Generic, TypeVar
|
|
10
|
-
|
|
11
|
-
if TYPE_CHECKING: # pragma: no cover, no mutate
|
|
12
|
-
from typing import Any, Union, Self
|
|
13
|
-
|
|
14
|
-
from . import AbstractSpaceHook as Hook
|
|
15
|
-
|
|
16
|
-
NamespaceT = TypeVar('NamespaceT')
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class SpaceDesc(Generic[NamespaceT]):
|
|
20
|
-
"""
|
|
21
|
-
A hook method must reach the namespace whose class body it is working
|
|
22
|
-
on, and one hook object serves every namespace of its class.
|
|
23
|
-
|
|
24
|
-
Implementation
|
|
25
|
-
--------------
|
|
26
|
-
|
|
27
|
-
Through a hook, the descriptor returns '__space_object__', the
|
|
28
|
-
namespace that last read the hook; through the class, itself.
|
|
29
|
-
"""
|
|
30
|
-
|
|
31
|
-
# @formatter:off
|
|
32
|
-
@overload
|
|
33
|
-
def __get__(self, instance: None, owner: type) -> Self: ...
|
|
34
|
-
@overload
|
|
35
|
-
def __get__(self, instance: Hook, owner: type) -> NamespaceT: ...
|
|
36
|
-
# @formatter:on
|
|
37
|
-
|
|
38
|
-
def __get__(self, instance: Any, owner: type) -> Union[Self, NamespaceT]:
|
|
39
|
-
"""
|
|
40
|
-
Accessed on a hook instance, '__get__' returns the namespace object
|
|
41
|
-
bound to that hook; accessed on the class, it returns the descriptor
|
|
42
|
-
itself.
|
|
43
|
-
"""
|
|
44
|
-
if instance is None:
|
|
45
|
-
return self
|
|
46
|
-
return object.__getattribute__(instance, '__space_object__')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|