omlish 0.0.0.dev453__py3-none-any.whl → 0.0.0.dev454__py3-none-any.whl
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.
- omlish/__about__.py +2 -2
- omlish/collections/identity.py +1 -0
- omlish/dataclasses/__init__.py +2 -0
- omlish/funcs/guard.py +27 -16
- omlish/lang/__init__.py +1 -0
- omlish/lang/iterables.py +8 -0
- omlish/lite/attrops.py +2 -0
- omlish/lite/dataclasses.py +30 -0
- omlish/marshal/__init__.py +12 -11
- omlish/marshal/base/contexts.py +4 -7
- omlish/marshal/base/funcs.py +16 -11
- omlish/marshal/base/types.py +17 -7
- omlish/marshal/composite/iterables.py +31 -20
- omlish/marshal/composite/literals.py +14 -18
- omlish/marshal/composite/mappings.py +34 -23
- omlish/marshal/composite/maybes.py +27 -19
- omlish/marshal/composite/newtypes.py +14 -14
- omlish/marshal/composite/optionals.py +12 -14
- omlish/marshal/composite/special.py +13 -13
- omlish/marshal/composite/unions/__init__.py +0 -0
- omlish/marshal/composite/unions/literals.py +91 -0
- omlish/marshal/composite/unions/primitives.py +101 -0
- omlish/marshal/factories/invalidate.py +16 -66
- omlish/marshal/factories/method.py +28 -0
- omlish/marshal/factories/moduleimport/factories.py +13 -54
- omlish/marshal/factories/multi.py +11 -23
- omlish/marshal/factories/recursive.py +40 -56
- omlish/marshal/factories/typecache.py +23 -75
- omlish/marshal/factories/typemap.py +40 -41
- omlish/marshal/objects/dataclasses.py +106 -97
- omlish/marshal/objects/marshal.py +15 -12
- omlish/marshal/objects/namedtuples.py +46 -40
- omlish/marshal/objects/unmarshal.py +16 -13
- omlish/marshal/polymorphism/marshal.py +6 -9
- omlish/marshal/polymorphism/unions.py +15 -9
- omlish/marshal/polymorphism/unmarshal.py +6 -8
- omlish/marshal/singular/enums.py +12 -18
- omlish/marshal/standard.py +8 -8
- omlish/marshal/trivial/forbidden.py +19 -24
- omlish/os/forkhooks.py +4 -0
- omlish/specs/jsonrpc/_marshal.py +33 -24
- omlish/specs/openapi/_marshal.py +20 -17
- omlish/typedvalues/marshal.py +81 -55
- {omlish-0.0.0.dev453.dist-info → omlish-0.0.0.dev454.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev453.dist-info → omlish-0.0.0.dev454.dist-info}/RECORD +49 -48
- omlish/marshal/composite/unions.py +0 -213
- omlish/marshal/factories/match.py +0 -34
- omlish/marshal/factories/simple.py +0 -28
- {omlish-0.0.0.dev453.dist-info → omlish-0.0.0.dev454.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev453.dist-info → omlish-0.0.0.dev454.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev453.dist-info → omlish-0.0.0.dev454.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev453.dist-info → omlish-0.0.0.dev454.dist-info}/top_level.txt +0 -0
omlish/marshal/standard.py
CHANGED
@@ -22,10 +22,10 @@ from .composite.optionals import OptionalMarshalerFactory
|
|
22
22
|
from .composite.optionals import OptionalUnmarshalerFactory
|
23
23
|
from .composite.special import SequenceNotStrMarshalerFactory
|
24
24
|
from .composite.special import SequenceNotStrUnmarshalerFactory
|
25
|
-
from .composite.unions import LiteralUnionMarshalerFactory
|
26
|
-
from .composite.unions import LiteralUnionUnmarshalerFactory
|
27
|
-
from .composite.unions import PrimitiveUnionMarshalerFactory
|
28
|
-
from .composite.unions import PrimitiveUnionUnmarshalerFactory
|
25
|
+
from .composite.unions.literals import LiteralUnionMarshalerFactory
|
26
|
+
from .composite.unions.literals import LiteralUnionUnmarshalerFactory
|
27
|
+
from .composite.unions.primitives import PrimitiveUnionMarshalerFactory
|
28
|
+
from .composite.unions.primitives import PrimitiveUnionUnmarshalerFactory
|
29
29
|
from .factories.invalidate import InvalidatableMarshalerFactory
|
30
30
|
from .factories.invalidate import InvalidatableUnmarshalerFactory
|
31
31
|
from .factories.moduleimport.factories import ModuleImportingMarshalerFactory
|
@@ -119,11 +119,11 @@ def new_standard_marshaler_factory(
|
|
119
119
|
nonlocal gl
|
120
120
|
gl = DEFAULT_STANDARD_FACTORIES
|
121
121
|
|
122
|
-
fi: MarshalerFactory = MultiMarshalerFactory(
|
122
|
+
fi: MarshalerFactory = MultiMarshalerFactory(
|
123
123
|
*(first if first is not None else []),
|
124
124
|
*gl.marshaler_factories,
|
125
125
|
*(last if last is not None else []),
|
126
|
-
|
126
|
+
)
|
127
127
|
|
128
128
|
fi = RecursiveMarshalerFactory(fi)
|
129
129
|
|
@@ -152,11 +152,11 @@ def new_standard_unmarshaler_factory(
|
|
152
152
|
nonlocal gl
|
153
153
|
gl = DEFAULT_STANDARD_FACTORIES
|
154
154
|
|
155
|
-
fi: UnmarshalerFactory = MultiUnmarshalerFactory(
|
155
|
+
fi: UnmarshalerFactory = MultiUnmarshalerFactory(
|
156
156
|
*(first if first is not None else []),
|
157
157
|
*gl.unmarshaler_factories,
|
158
158
|
*(last if last is not None else []),
|
159
|
-
|
159
|
+
)
|
160
160
|
|
161
161
|
fi = RecursiveUnmarshalerFactory(fi)
|
162
162
|
|
@@ -2,45 +2,40 @@ import dataclasses as dc
|
|
2
2
|
import typing as ta
|
3
3
|
|
4
4
|
from ... import reflect as rfl
|
5
|
-
from ...funcs import match as mfs
|
6
5
|
from ..base.contexts import MarshalContext
|
7
6
|
from ..base.contexts import UnmarshalContext
|
8
7
|
from ..base.errors import ForbiddenTypeError
|
9
8
|
from ..base.types import Marshaler
|
9
|
+
from ..base.types import MarshalerFactory
|
10
10
|
from ..base.types import Unmarshaler
|
11
|
-
from ..
|
12
|
-
from ..factories.simple import SimpleUnmarshalerFactory
|
13
|
-
|
14
|
-
|
15
|
-
C = ta.TypeVar('C')
|
16
|
-
R = ta.TypeVar('R')
|
11
|
+
from ..base.types import UnmarshalerFactory
|
17
12
|
|
18
13
|
|
19
14
|
##
|
20
15
|
|
21
16
|
|
22
17
|
@dc.dataclass(frozen=True)
|
23
|
-
class
|
18
|
+
class ForbiddenTypeMarshalerFactoryUnmarshalerFactory(MarshalerFactory, UnmarshalerFactory):
|
24
19
|
rtys: ta.AbstractSet[rfl.Type]
|
25
20
|
|
26
|
-
def
|
27
|
-
|
21
|
+
def make_marshaler(self, ctx: MarshalContext, rty: rfl.Type) -> ta.Callable[[], Marshaler] | None:
|
22
|
+
if rty not in self.rtys:
|
23
|
+
return None
|
28
24
|
|
29
|
-
|
30
|
-
|
25
|
+
def inner():
|
26
|
+
raise ForbiddenTypeError(rty)
|
31
27
|
|
28
|
+
return inner
|
32
29
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
SimpleMarshalerFactory,
|
37
|
-
):
|
38
|
-
pass
|
30
|
+
def make_unmarshaler(self, ctx: UnmarshalContext, rty: rfl.Type) -> ta.Callable[[], Unmarshaler] | None:
|
31
|
+
if rty not in self.rtys:
|
32
|
+
return None
|
39
33
|
|
34
|
+
def inner():
|
35
|
+
raise ForbiddenTypeError(rty)
|
40
36
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
pass
|
37
|
+
return inner
|
38
|
+
|
39
|
+
|
40
|
+
ForbiddenTypeMarshalerFactory = ForbiddenTypeMarshalerFactoryUnmarshalerFactory
|
41
|
+
ForbiddenTypeUnmarshalerFactory = ForbiddenTypeMarshalerFactoryUnmarshalerFactory
|
omlish/os/forkhooks.py
CHANGED
omlish/specs/jsonrpc/_marshal.py
CHANGED
@@ -5,7 +5,6 @@ from ... import dataclasses as dc
|
|
5
5
|
from ... import lang
|
6
6
|
from ... import marshal as msh
|
7
7
|
from ... import reflect as rfl
|
8
|
-
from ...funcs import match as mfs
|
9
8
|
from .types import NotSpecified
|
10
9
|
|
11
10
|
|
@@ -25,29 +24,39 @@ class NotSpecifiedUnionMarshaler(msh.Marshaler):
|
|
25
24
|
return self.m.marshal(ctx, o)
|
26
25
|
|
27
26
|
|
28
|
-
class NotSpecifiedUnionMarshalerFactory(msh.
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
def
|
48
|
-
|
49
|
-
|
50
|
-
|
27
|
+
class NotSpecifiedUnionMarshalerFactory(msh.MarshalerFactory):
|
28
|
+
def make_marshaler(self, ctx: msh.MarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Marshaler] | None:
|
29
|
+
if not (
|
30
|
+
isinstance(rty, rfl.Union) and
|
31
|
+
not rty.is_optional and
|
32
|
+
_NOT_SPECIFIED_RTY in rty.args
|
33
|
+
):
|
34
|
+
return None
|
35
|
+
|
36
|
+
def inner() -> msh.Marshaler:
|
37
|
+
args = set(check.isinstance(rty, rfl.Union).args) - {_NOT_SPECIFIED_RTY}
|
38
|
+
nty = rfl.type_(ta.Union[*args])
|
39
|
+
m = ctx.make(nty)
|
40
|
+
return NotSpecifiedUnionMarshaler(m)
|
41
|
+
|
42
|
+
return inner
|
43
|
+
|
44
|
+
|
45
|
+
class NotSpecifiedUnionUnmarshalerFactory(msh.UnmarshalerFactory):
|
46
|
+
def make_unmarshaler(self, ctx: msh.UnmarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Unmarshaler] | None:
|
47
|
+
if not (
|
48
|
+
isinstance(rty, rfl.Union) and
|
49
|
+
not rty.is_optional and
|
50
|
+
_NOT_SPECIFIED_RTY in rty.args
|
51
|
+
):
|
52
|
+
return None
|
53
|
+
|
54
|
+
def inner() -> msh.Unmarshaler:
|
55
|
+
args = set(check.isinstance(rty, rfl.Union).args) - {_NOT_SPECIFIED_RTY}
|
56
|
+
nty = rfl.type_(ta.Union[*args])
|
57
|
+
return ctx.make(nty)
|
58
|
+
|
59
|
+
return inner
|
51
60
|
|
52
61
|
|
53
62
|
@lang.static_init
|
omlish/specs/openapi/_marshal.py
CHANGED
@@ -5,7 +5,6 @@ from ... import dataclasses as dc
|
|
5
5
|
from ... import lang
|
6
6
|
from ... import marshal as msh
|
7
7
|
from ... import reflect as rfl
|
8
|
-
from ...funcs import match as mfs
|
9
8
|
from .. import jsonschema as jsch
|
10
9
|
from .openapi import Reference
|
11
10
|
from .openapi import Schema
|
@@ -36,10 +35,11 @@ class _ReferenceUnionMarshaler(msh.Marshaler):
|
|
36
35
|
return self.m.marshal(ctx, o)
|
37
36
|
|
38
37
|
|
39
|
-
class _ReferenceUnionMarshalerFactory(msh.
|
40
|
-
|
41
|
-
|
42
|
-
|
38
|
+
class _ReferenceUnionMarshalerFactory(msh.MarshalerFactory):
|
39
|
+
def make_marshaler(self, ctx: msh.MarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Marshaler] | None:
|
40
|
+
if (rua := _reference_union_arg(rty)) is None:
|
41
|
+
return None
|
42
|
+
return lambda: _ReferenceUnionMarshaler(ctx.make(check.not_none(rua)), ctx.make(Reference))
|
43
43
|
|
44
44
|
|
45
45
|
#
|
@@ -59,10 +59,11 @@ class _ReferenceUnionUnmarshaler(msh.Unmarshaler):
|
|
59
59
|
return self.u.unmarshal(ctx, v) # noqa
|
60
60
|
|
61
61
|
|
62
|
-
class _ReferenceUnionUnmarshalerFactory(msh.
|
63
|
-
|
64
|
-
|
65
|
-
|
62
|
+
class _ReferenceUnionUnmarshalerFactory(msh.UnmarshalerFactory):
|
63
|
+
def make_unmarshaler(self, ctx: msh.UnmarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Unmarshaler] | None:
|
64
|
+
if (rua := _reference_union_arg(rty)) is None:
|
65
|
+
return None
|
66
|
+
return lambda: _ReferenceUnionUnmarshaler(ctx.make(check.not_none(rua)), ctx.make(Reference))
|
66
67
|
|
67
68
|
|
68
69
|
##
|
@@ -86,10 +87,11 @@ class _SchemaMarshaler(msh.Marshaler):
|
|
86
87
|
return dct
|
87
88
|
|
88
89
|
|
89
|
-
class _SchemaMarshalerFactory(msh.
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
class _SchemaMarshalerFactory(msh.MarshalerFactory):
|
91
|
+
def make_marshaler(self, ctx: msh.MarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Marshaler] | None:
|
92
|
+
if rty is not Schema:
|
93
|
+
return None
|
94
|
+
return lambda: _SchemaMarshaler(
|
93
95
|
{
|
94
96
|
f: (msh.translate_name(f, msh.Naming.LOW_CAMEL), ctx.make(rfl.type_(a)))
|
95
97
|
for f, a in dc.reflect(Schema).field_annotations.items()
|
@@ -121,10 +123,11 @@ class _SchemaUnmarshaler(msh.Unmarshaler):
|
|
121
123
|
return Schema(**kw)
|
122
124
|
|
123
125
|
|
124
|
-
class _SchemaUnmarshalerFactory(msh.
|
125
|
-
|
126
|
-
|
127
|
-
|
126
|
+
class _SchemaUnmarshalerFactory(msh.UnmarshalerFactory):
|
127
|
+
def make_unmarshaler(self, ctx: msh.UnmarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Unmarshaler] | None:
|
128
|
+
if rty is not Schema:
|
129
|
+
return None
|
130
|
+
return lambda: _SchemaUnmarshaler(
|
128
131
|
{
|
129
132
|
msh.translate_name(f, msh.Naming.LOW_CAMEL): (f, ctx.make(rfl.type_(a)))
|
130
133
|
for f, a in dc.reflect(Schema).field_annotations.items()
|
omlish/typedvalues/marshal.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
+
import typing as ta
|
2
|
+
|
1
3
|
from .. import check
|
2
4
|
from .. import dataclasses as dc
|
3
5
|
from .. import lang
|
4
6
|
from .. import marshal as msh
|
5
7
|
from .. import reflect as rfl
|
6
|
-
from ..funcs import match as mfs
|
7
8
|
from .collection import TypedValues
|
8
9
|
from .reflect import reflect_typed_values_impls
|
9
10
|
from .values import ScalarTypedValue
|
@@ -14,7 +15,7 @@ from .values import TypedValue
|
|
14
15
|
|
15
16
|
|
16
17
|
def _build_typed_value_poly(rty: rfl.Type) -> msh.Polymorphism:
|
17
|
-
ty: type[TypedValue] = check.issubclass(check.isinstance(rty, type), TypedValue)
|
18
|
+
ty: type[TypedValue] = check.issubclass(check.isinstance(rty, type), TypedValue) # noqa
|
18
19
|
check.state(lang.is_abstract_class(ty))
|
19
20
|
return msh.polymorphism_from_subclasses(
|
20
21
|
ty,
|
@@ -23,51 +24,68 @@ def _build_typed_value_poly(rty: rfl.Type) -> msh.Polymorphism:
|
|
23
24
|
)
|
24
25
|
|
25
26
|
|
26
|
-
class TypedValueMarshalerFactory(msh.
|
27
|
-
@
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
27
|
+
class TypedValueMarshalerFactory(msh.MarshalerFactoryMethodClass):
|
28
|
+
@msh.MarshalerFactoryMethodClass.make_marshaler.register
|
29
|
+
def _make_scalar(self, ctx: msh.MarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Marshaler] | None:
|
30
|
+
if not (
|
31
|
+
isinstance(rty, type) and
|
32
|
+
issubclass(rty, ScalarTypedValue) and
|
33
|
+
not lang.is_abstract_class(rty)
|
34
|
+
):
|
35
|
+
return None
|
36
|
+
|
37
|
+
def inner() -> msh.Marshaler:
|
38
|
+
dc_rfl = dc.reflect(check.isinstance(rty, type))
|
39
|
+
v_rty = check.single(dc_rfl.fields_inspection.generic_replaced_field_annotations.values())
|
40
|
+
v_m = ctx.make(v_rty)
|
41
|
+
return msh.WrappedMarshaler(lambda _, o: o.v, v_m)
|
42
|
+
|
43
|
+
return inner
|
44
|
+
|
45
|
+
@msh.MarshalerFactoryMethodClass.make_marshaler.register
|
46
|
+
def _make_abstract(self, ctx: msh.MarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Marshaler] | None:
|
47
|
+
if not (
|
48
|
+
isinstance(rty, type) and
|
49
|
+
issubclass(rty, TypedValue) and
|
50
|
+
lang.is_abstract_class(rty)
|
51
|
+
):
|
52
|
+
return None
|
53
|
+
|
54
|
+
return lambda: msh.make_polymorphism_marshaler(
|
45
55
|
_build_typed_value_poly(rty).impls,
|
46
56
|
msh.WrapperTypeTagging(),
|
47
57
|
ctx,
|
48
58
|
)
|
49
59
|
|
50
60
|
|
51
|
-
class TypedValueUnmarshalerFactory(msh.
|
52
|
-
@
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
61
|
+
class TypedValueUnmarshalerFactory(msh.UnmarshalerFactoryMethodClass):
|
62
|
+
@msh.UnmarshalerFactoryMethodClass.make_unmarshaler.register
|
63
|
+
def _make_scalar(self, ctx: msh.UnmarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Unmarshaler] | None:
|
64
|
+
if not (
|
65
|
+
isinstance(rty, type) and
|
66
|
+
issubclass(rty, ScalarTypedValue) and
|
67
|
+
not lang.is_abstract_class(rty)
|
68
|
+
):
|
69
|
+
return None
|
70
|
+
|
71
|
+
def inner() -> msh.Unmarshaler:
|
72
|
+
dc_rfl = dc.reflect(rty)
|
73
|
+
v_rty = check.single(dc_rfl.fields_inspection.generic_replaced_field_annotations.values())
|
74
|
+
v_u = ctx.make(v_rty)
|
75
|
+
return msh.WrappedUnmarshaler(lambda _, v: rty(v), v_u)
|
76
|
+
|
77
|
+
return inner
|
78
|
+
|
79
|
+
@msh.UnmarshalerFactoryMethodClass.make_unmarshaler.register
|
80
|
+
def _make_abstract(self, ctx: msh.UnmarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Unmarshaler] | None:
|
81
|
+
if not (
|
82
|
+
isinstance(rty, type) and
|
83
|
+
issubclass(rty, TypedValue) and
|
84
|
+
lang.is_abstract_class(rty)
|
85
|
+
):
|
86
|
+
return None
|
87
|
+
|
88
|
+
return lambda: msh.make_polymorphism_unmarshaler(
|
71
89
|
_build_typed_value_poly(rty).impls,
|
72
90
|
msh.WrapperTypeTagging(),
|
73
91
|
ctx,
|
@@ -108,14 +126,18 @@ def build_typed_values_marshaler(ctx: msh.MarshalContext, rty: rfl.Type) -> msh.
|
|
108
126
|
return msh.IterableMarshaler(tv_m)
|
109
127
|
|
110
128
|
|
111
|
-
class TypedValuesMarshalerFactory(msh.
|
112
|
-
@
|
113
|
-
def
|
114
|
-
|
129
|
+
class TypedValuesMarshalerFactory(msh.MarshalerFactoryMethodClass):
|
130
|
+
@msh.MarshalerFactoryMethodClass.make_marshaler.register
|
131
|
+
def _make_generic(self, ctx: msh.MarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Marshaler] | None:
|
132
|
+
if not (isinstance(rty, rfl.Generic) and rty.cls is TypedValues):
|
133
|
+
return None
|
134
|
+
return lambda: build_typed_values_marshaler(ctx, rty)
|
115
135
|
|
116
|
-
@
|
117
|
-
def
|
118
|
-
|
136
|
+
@msh.MarshalerFactoryMethodClass.make_marshaler.register
|
137
|
+
def _make_concrete(self, ctx: msh.MarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Marshaler] | None:
|
138
|
+
if rty is not TypedValues:
|
139
|
+
return None
|
140
|
+
return lambda: lang.raise_(NotImplementedError())
|
119
141
|
|
120
142
|
|
121
143
|
#
|
@@ -130,14 +152,18 @@ def build_typed_values_unmarshaler(ctx: msh.UnmarshalContext, rty: rfl.Type) ->
|
|
130
152
|
return msh.IterableUnmarshaler(lambda it: TypedValues(*it), tv_u) # noqa
|
131
153
|
|
132
154
|
|
133
|
-
class TypedValuesUnmarshalerFactory(msh.
|
134
|
-
@
|
135
|
-
def _build(self, ctx: msh.UnmarshalContext, rty: rfl.Type) -> msh.Unmarshaler:
|
136
|
-
|
155
|
+
class TypedValuesUnmarshalerFactory(msh.UnmarshalerFactoryMethodClass):
|
156
|
+
@msh.UnmarshalerFactoryMethodClass.make_unmarshaler.register
|
157
|
+
def _build(self, ctx: msh.UnmarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Unmarshaler] | None:
|
158
|
+
if not (isinstance(rty, rfl.Generic) and rty.cls is TypedValues):
|
159
|
+
return None
|
160
|
+
return lambda: build_typed_values_unmarshaler(ctx, rty)
|
137
161
|
|
138
|
-
@
|
139
|
-
def _build_concrete(self, ctx: msh.UnmarshalContext, rty: rfl.Type) -> msh.Unmarshaler:
|
140
|
-
|
162
|
+
@msh.UnmarshalerFactoryMethodClass.make_unmarshaler.register
|
163
|
+
def _build_concrete(self, ctx: msh.UnmarshalContext, rty: rfl.Type) -> ta.Callable[[], msh.Unmarshaler] | None:
|
164
|
+
if rty is not TypedValues:
|
165
|
+
return None
|
166
|
+
return lambda: lang.raise_(NotImplementedError())
|
141
167
|
|
142
168
|
|
143
169
|
##
|