Created
June 17, 2024 10:44
-
-
Save mweinelt/b762076c1424595191b8c9859cfd0686 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mashumaro> ______________ test_with_generic_mapping[key_info3-value_info45] _______________ | |
mashumaro> [gw31] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123) | |
mashumaro> value_info = (~TMyDataClass, MyDataClass(a=1, b=2), {'a': 1, 'b': 2}) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_mapping(key_info, value_info): | |
mashumaro> > check_mapping_generic(Mapping, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:570: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TMyDataClass) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TMyDataClass without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ________________ test_with_generic_dict[key_info3-value_info0] _________________ | |
mashumaro> [gw5] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~T, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_dict(key_info, value_info): | |
mashumaro> > check_mapping_generic(Dict, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:564: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~T) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~T without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ________________ test_with_generic_dict[key_info3-value_info1] _________________ | |
mashumaro> [gw5] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TInt, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_dict(key_info, value_info): | |
mashumaro> > check_mapping_generic(Dict, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:564: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TInt) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TInt without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ________________ test_with_generic_dict[key_info3-value_info2] _________________ | |
mashumaro> [gw5] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TIntStr, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_dict(key_info, value_info): | |
mashumaro> > check_mapping_generic(Dict, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:564: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TIntStr) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TIntStr without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ________________ test_with_generic_dict[key_info3-value_info5] _________________ | |
mashumaro> [gw5] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TAny, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_dict(key_info, value_info): | |
mashumaro> > check_mapping_generic(Dict, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:564: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TAny) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TAny without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> _______________ test_with_generic_mapping[key_info3-value_info0] _______________ | |
mashumaro> [gw30] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~T, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_mapping(key_info, value_info): | |
mashumaro> > check_mapping_generic(Mapping, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:570: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~T) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~T without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> _______________ test_with_generic_mapping[key_info3-value_info1] _______________ | |
mashumaro> [gw30] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TInt, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_mapping(key_info, value_info): | |
mashumaro> > check_mapping_generic(Mapping, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:570: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TInt) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TInt without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> _______________ test_with_generic_mapping[key_info3-value_info2] _______________ | |
mashumaro> [gw30] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TIntStr, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_mapping(key_info, value_info): | |
mashumaro> > check_mapping_generic(Mapping, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:570: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TIntStr) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TIntStr without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> _______________ test_with_generic_mapping[key_info3-value_info5] _______________ | |
mashumaro> [gw30] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TAny, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_mapping(key_info, value_info): | |
mashumaro> > check_mapping_generic(Mapping, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:570: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TAny) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TAny without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ________________ test_with_generic_dict[key_info3-value_info45] ________________ | |
mashumaro> [gw5] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123) | |
mashumaro> value_info = (~TMyDataClass, MyDataClass(a=1, b=2), {'a': 1, 'b': 2}) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_dict(key_info, value_info): | |
mashumaro> > check_mapping_generic(Dict, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:564: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TMyDataClass) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TMyDataClass without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ____________ test_with_generic_ordered_dict[key_info3-value_info0] _____________ | |
mashumaro> [gw19] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~T, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_ordered_dict(key_info, value_info): | |
mashumaro> > check_mapping_generic(OrderedDict, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:576: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~T) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~T without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ____________ test_with_generic_ordered_dict[key_info3-value_info1] _____________ | |
mashumaro> [gw19] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TInt, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_ordered_dict(key_info, value_info): | |
mashumaro> > check_mapping_generic(OrderedDict, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:576: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TInt) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TInt without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ____________ test_with_generic_ordered_dict[key_info3-value_info2] _____________ | |
mashumaro> [gw19] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TIntStr, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_ordered_dict(key_info, value_info): | |
mashumaro> > check_mapping_generic(OrderedDict, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:576: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TIntStr) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TIntStr without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ____________ test_with_generic_ordered_dict[key_info3-value_info5] _____________ | |
mashumaro> [gw19] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TAny, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_ordered_dict(key_info, value_info): | |
mashumaro> > check_mapping_generic(OrderedDict, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:576: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TAny) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TAny without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ____________ test_with_generic_ordered_dict[key_info3-value_info45] ____________ | |
mashumaro> [gw19] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123) | |
mashumaro> value_info = (~TMyDataClass, MyDataClass(a=1, b=2), {'a': 1, 'b': 2}) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_ordered_dict(key_info, value_info): | |
mashumaro> > check_mapping_generic(OrderedDict, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:576: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TMyDataClass) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TMyDataClass without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ___________ test_with_generic_mutable_mapping[key_info3-value_info0] ___________ | |
mashumaro> [gw2] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~T, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_mutable_mapping(key_info, value_info): | |
mashumaro> > check_mapping_generic(MutableMapping, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:588: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~T) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~T without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ___________ test_with_generic_mutable_mapping[key_info3-value_info1] ___________ | |
mashumaro> [gw2] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TInt, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_mutable_mapping(key_info, value_info): | |
mashumaro> > check_mapping_generic(MutableMapping, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:588: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TInt) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TInt without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ___________ test_with_generic_mutable_mapping[key_info3-value_info2] ___________ | |
mashumaro> [gw2] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TIntStr, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_mutable_mapping(key_info, value_info): | |
mashumaro> > check_mapping_generic(MutableMapping, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:588: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TIntStr) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TIntStr without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ___________ test_with_generic_mutable_mapping[key_info3-value_info5] ___________ | |
mashumaro> [gw2] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TAny, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_mutable_mapping(key_info, value_info): | |
mashumaro> > check_mapping_generic(MutableMapping, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:588: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TAny) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TAny without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> __________ test_with_generic_mutable_mapping[key_info3-value_info45] ___________ | |
mashumaro> [gw4] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123) | |
mashumaro> value_info = (~TMyDataClass, MyDataClass(a=1, b=2), {'a': 1, 'b': 2}) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_mutable_mapping(key_info, value_info): | |
mashumaro> > check_mapping_generic(MutableMapping, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:588: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TMyDataClass) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TMyDataClass without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ______________ test_with_generic_chain_map[key_info3-value_info0] ______________ | |
mashumaro> [gw38] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~T, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_chain_map(key_info, value_info): | |
mashumaro> > check_mapping_generic(ChainMap, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:594: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~T) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~T without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ______________ test_with_generic_chain_map[key_info3-value_info1] ______________ | |
mashumaro> [gw38] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TInt, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_chain_map(key_info, value_info): | |
mashumaro> > check_mapping_generic(ChainMap, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:594: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TInt) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TInt without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> _____________ test_with_generic_chain_map[key_info3-value_info45] ______________ | |
mashumaro> [gw13] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123) | |
mashumaro> value_info = (~TMyDataClass, MyDataClass(a=1, b=2), {'a': 1, 'b': 2}) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_chain_map(key_info, value_info): | |
mashumaro> > check_mapping_generic(ChainMap, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:594: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TMyDataClass) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TMyDataClass without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ______________ test_with_generic_chain_map[key_info3-value_info2] ______________ | |
mashumaro> [gw38] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TIntStr, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_chain_map(key_info, value_info): | |
mashumaro> > check_mapping_generic(ChainMap, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:594: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TIntStr) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TIntStr without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> ______________ test_with_generic_chain_map[key_info3-value_info5] ______________ | |
mashumaro> [gw38] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> key_info = (~TDefaultInt, 123, 123), value_info = (~TAny, 123, 123) | |
mashumaro> | |
mashumaro> @pytest.mark.parametrize("value_info", inner_values) | |
mashumaro> @pytest.mark.parametrize("key_info", hashable_inner_values) | |
mashumaro> def test_with_generic_chain_map(key_info, value_info): | |
mashumaro> > check_mapping_generic(ChainMap, key_info, value_info) | |
mashumaro> | |
mashumaro> tests/test_data_types.py:594: | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> tests/test_data_types.py:483: in check_mapping_generic | |
mashumaro> x_type = type_[k_type, v_type] | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:398: in inner | |
mashumaro> return func(*args, **kwds) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1474: in __getitem__ | |
mashumaro> return self.copy_with(params) | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1477: in copy_with | |
mashumaro> return _GenericAlias(self.__origin__, params, | |
mashumaro> /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/lib/python3.12/typing.py:1266: in __init__ | |
mashumaro> self.__parameters__ = _collect_parameters(args) | |
mashumaro> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
mashumaro> | |
mashumaro> args = (~TDefaultInt, ~TAny) | |
mashumaro> | |
mashumaro> def _collect_parameters(args): | |
mashumaro> """Collect all type variables and parameter specifications in args | |
mashumaro> in order of first appearance (lexicographic order). | |
mashumaro> | |
mashumaro> For example:: | |
mashumaro> | |
mashumaro> assert _collect_parameters((T, Callable[P, T])) == (T, P) | |
mashumaro> """ | |
mashumaro> parameters = [] | |
mashumaro> # required TypeVarLike cannot appear after TypeVarLike with default | |
mashumaro> default_encountered = False | |
mashumaro> for t in args: | |
mashumaro> if isinstance(t, type): | |
mashumaro> # We don't want __parameters__ descriptor of a bare Python class. | |
mashumaro> pass | |
mashumaro> elif isinstance(t, tuple): | |
mashumaro> # `t` might be a tuple, when `ParamSpec` is substituted with | |
mashumaro> # `[T, int]`, or `[int, *Ts]`, etc. | |
mashumaro> for x in t: | |
mashumaro> for collected in _collect_parameters([x]): | |
mashumaro> if collected not in parameters: | |
mashumaro> parameters.append(collected) | |
mashumaro> elif hasattr(t, '__typing_subst__'): | |
mashumaro> if t not in parameters: | |
mashumaro> if getattr(t, '__default__', None) is not None: | |
mashumaro> default_encountered = True | |
mashumaro> elif default_encountered: | |
mashumaro> > raise TypeError(f'Type parameter {t!r} without a default' | |
mashumaro> ' follows type parameter with a default') | |
mashumaro> E TypeError: Type parameter ~TAny without a default follows type parameter with a default | |
mashumaro> | |
mashumaro> /nix/store/8w6wk8b51mz7i54pv0cmc8zsi4r30dxc-python3.12-typing-extensions-4.11.0/lib/python3.12/site-packages/typing_extensions.py:2788: TypeError | |
mashumaro> __________________________ test_get_type_var_default ___________________________ | |
mashumaro> [gw37] linux -- Python 3.12.4 /nix/store/89arss4li8g0g0nabm8a1q6dalzamvph-python3-3.12.4/bin/python3.12 | |
mashumaro> | |
mashumaro> def test_get_type_var_default(): | |
mashumaro> T_WithDefault = typing_extensions.TypeVar("T_WithDefault", default=int) | |
mashumaro> T_WithDefaultNone = typing_extensions.TypeVar( | |
mashumaro> "T_WithDefaultNone", default=None | |
mashumaro> ) | |
mashumaro> | |
mashumaro> assert get_type_var_default(T_WithDefault) is int | |
mashumaro> > assert get_type_var_default(T_WithDefaultNone) is None | |
mashumaro> E AssertionError: assert <class 'NoneType'> is None | |
mashumaro> E + where <class 'NoneType'> = get_type_var_default(~T_WithDefaultNone) | |
mashumaro> | |
mashumaro> tests/test_meta.py:833: AssertionError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment