omlish 0.0.0.dev451__py3-none-any.whl → 0.0.0.dev452__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/diag/pycharm.py +16 -2
- omlish/funcs/match.py +2 -0
- omlish/marshal/__init__.py +12 -5
- omlish/marshal/base/contexts.py +4 -2
- omlish/marshal/base/registries.py +119 -45
- omlish/marshal/composite/literals.py +6 -2
- omlish/marshal/composite/unions.py +213 -0
- omlish/marshal/factories/moduleimport/factories.py +8 -10
- omlish/marshal/polymorphism/metadata.py +16 -5
- omlish/marshal/polymorphism/standard.py +17 -3
- omlish/marshal/polymorphism/unions.py +0 -129
- omlish/marshal/standard.py +6 -2
- omlish/sql/queries/_marshal.py +1 -1
- omlish/typedvalues/marshal.py +1 -1
- {omlish-0.0.0.dev451.dist-info → omlish-0.0.0.dev452.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev451.dist-info → omlish-0.0.0.dev452.dist-info}/RECORD +21 -20
- {omlish-0.0.0.dev451.dist-info → omlish-0.0.0.dev452.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev451.dist-info → omlish-0.0.0.dev452.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev451.dist-info → omlish-0.0.0.dev452.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev451.dist-info → omlish-0.0.0.dev452.dist-info}/top_level.txt +0 -0
omlish/__about__.py
CHANGED
omlish/diag/pycharm.py
CHANGED
@@ -191,9 +191,23 @@ def pycharm_remote_debugger_attach(prd: PycharmRemoteDebugger) -> None:
|
|
191
191
|
else:
|
192
192
|
pydevd_pycharm = _import_pydevd_pycharm(version=version)
|
193
193
|
|
194
|
+
import inspect
|
195
|
+
st_sig = inspect.signature(pydevd_pycharm.settrace)
|
196
|
+
|
197
|
+
kw: dict = {}
|
198
|
+
if 'stdoutToServer' in st_sig.parameters:
|
199
|
+
kw.update(
|
200
|
+
stdoutToServer=True,
|
201
|
+
stderrToServer=True,
|
202
|
+
)
|
203
|
+
else:
|
204
|
+
kw.update(
|
205
|
+
stdout_to_server=True,
|
206
|
+
stderr_to_server=True,
|
207
|
+
)
|
208
|
+
|
194
209
|
pydevd_pycharm.settrace(
|
195
210
|
host,
|
196
211
|
port=prd.port,
|
197
|
-
|
198
|
-
stderrToServer=True,
|
212
|
+
**kw,
|
199
213
|
)
|
omlish/funcs/match.py
CHANGED
@@ -5,6 +5,8 @@ TODO:
|
|
5
5
|
- unify MatchFnClass with dispatch.method?
|
6
6
|
- __call__ = mfs.method(); @__call__.register(lambda: ...) def _call_... ?
|
7
7
|
- not really the same thing, dispatch is unordered this is necessarily ordered
|
8
|
+
- !! well.. unify interface at least?
|
9
|
+
- guard(*a, **k) -> bool + fn(*a, **k) -> T becomes dispatch(*a, **k) -> (Callable -> T) | None
|
8
10
|
"""
|
9
11
|
import abc
|
10
12
|
import dataclasses as dc
|
omlish/marshal/__init__.py
CHANGED
@@ -113,6 +113,17 @@ with _lang.auto_proxy_init(globals()):
|
|
113
113
|
OptionalUnmarshaler,
|
114
114
|
)
|
115
115
|
|
116
|
+
from .composite.unions import ( # noqa
|
117
|
+
MatchUnionMarshaler,
|
118
|
+
MatchUnionUnmarshaler,
|
119
|
+
|
120
|
+
PRIMITIVE_UNION_TYPES,
|
121
|
+
PrimitiveUnionMarshaler,
|
122
|
+
PrimitiveUnionMarshalerFactory,
|
123
|
+
PrimitiveUnionUnmarshaler,
|
124
|
+
PrimitiveUnionUnmarshalerFactory,
|
125
|
+
)
|
126
|
+
|
116
127
|
from .composite.wrapped import ( # noqa
|
117
128
|
WrappedMarshaler,
|
118
129
|
WrappedUnmarshaler,
|
@@ -197,6 +208,7 @@ with _lang.auto_proxy_init(globals()):
|
|
197
208
|
)
|
198
209
|
|
199
210
|
from .polymorphism.metadata import ( # noqa
|
211
|
+
AutoStripSuffix,
|
200
212
|
FieldTypeTagging,
|
201
213
|
Impl,
|
202
214
|
Impls,
|
@@ -212,13 +224,8 @@ with _lang.auto_proxy_init(globals()):
|
|
212
224
|
)
|
213
225
|
|
214
226
|
from .polymorphism.unions import ( # noqa
|
215
|
-
PRIMITIVE_UNION_TYPES,
|
216
227
|
PolymorphismUnionMarshalerFactory,
|
217
228
|
PolymorphismUnionUnmarshalerFactory,
|
218
|
-
PrimitiveUnionMarshaler,
|
219
|
-
PrimitiveUnionMarshalerFactory,
|
220
|
-
PrimitiveUnionUnmarshaler,
|
221
|
-
PrimitiveUnionUnmarshalerFactory,
|
222
229
|
)
|
223
230
|
|
224
231
|
from .polymorphism.unmarshal import ( # noqa
|
omlish/marshal/base/contexts.py
CHANGED
@@ -47,8 +47,9 @@ class MarshalContext(BaseContext, lang.Final):
|
|
47
47
|
|
48
48
|
def make(self, o: ta.Any) -> 'Marshaler':
|
49
49
|
rty = self._reflect(o)
|
50
|
+
fac = check.not_none(self.factory)
|
50
51
|
try:
|
51
|
-
return
|
52
|
+
return fac.make_marshaler(self, rty)
|
52
53
|
except mfs.MatchGuardError:
|
53
54
|
raise UnhandledTypeError(rty) # noqa
|
54
55
|
|
@@ -62,8 +63,9 @@ class UnmarshalContext(BaseContext, lang.Final):
|
|
62
63
|
|
63
64
|
def make(self, o: ta.Any) -> 'Unmarshaler':
|
64
65
|
rty = self._reflect(o)
|
66
|
+
fac = check.not_none(self.factory)
|
65
67
|
try:
|
66
|
-
return
|
68
|
+
return fac.make_unmarshaler(self, rty)
|
67
69
|
except mfs.MatchGuardError:
|
68
70
|
raise UnhandledTypeError(rty) # noqa
|
69
71
|
|
@@ -7,7 +7,6 @@ import dataclasses as dc
|
|
7
7
|
import threading
|
8
8
|
import typing as ta
|
9
9
|
|
10
|
-
from ... import collections as col
|
11
10
|
from ... import lang
|
12
11
|
|
13
12
|
|
@@ -22,18 +21,6 @@ RegistryItemT = ta.TypeVar('RegistryItemT', bound=RegistryItem)
|
|
22
21
|
RegistryItemU = ta.TypeVar('RegistryItemU', bound=RegistryItem)
|
23
22
|
|
24
23
|
|
25
|
-
@dc.dataclass(frozen=True)
|
26
|
-
class _KeyRegistryItems(ta.Generic[RegistryItemT]):
|
27
|
-
key: ta.Any
|
28
|
-
items: list[RegistryItemT] = dc.field(default_factory=list)
|
29
|
-
item_lists_by_ty: dict[type[RegistryItemT], list[RegistryItemT]] = dc.field(default_factory=dict)
|
30
|
-
|
31
|
-
def add(self, *items: RegistryItemT) -> None:
|
32
|
-
for i in items:
|
33
|
-
self.items.append(i)
|
34
|
-
self.item_lists_by_ty.setdefault(type(i), []).append(i)
|
35
|
-
|
36
|
-
|
37
24
|
class RegistrySealedError(Exception):
|
38
25
|
pass
|
39
26
|
|
@@ -50,14 +37,123 @@ class Registry(ta.Generic[RegistryItemT]):
|
|
50
37
|
lock = threading.RLock()
|
51
38
|
self._lock = lock
|
52
39
|
|
53
|
-
self.
|
54
|
-
|
40
|
+
self._state: Registry._State[RegistryItemT] = Registry._State(
|
41
|
+
dct={},
|
42
|
+
id_dct={},
|
43
|
+
version=0,
|
44
|
+
)
|
55
45
|
|
56
|
-
self._version = 0
|
57
46
|
self._sealed = False
|
58
47
|
|
59
48
|
#
|
60
49
|
|
50
|
+
@dc.dataclass(frozen=True)
|
51
|
+
class _KeyItems(ta.Generic[RegistryItemU]):
|
52
|
+
key: ta.Any
|
53
|
+
items: ta.Sequence[RegistryItemU] = ()
|
54
|
+
item_lists_by_ty: ta.Mapping[type[RegistryItemU], ta.Sequence[RegistryItemU]] = dc.field(default_factory=dict)
|
55
|
+
|
56
|
+
def add(self, *items: RegistryItemU) -> 'Registry._KeyItems[RegistryItemU]':
|
57
|
+
item_lists_by_ty: dict[type[RegistryItemU], list[RegistryItemU]] = {}
|
58
|
+
|
59
|
+
for i in items:
|
60
|
+
try:
|
61
|
+
l = item_lists_by_ty[type(i)]
|
62
|
+
except KeyError:
|
63
|
+
l = item_lists_by_ty[type(i)] = list(self.item_lists_by_ty.get(type(i), ()))
|
64
|
+
l.append(i)
|
65
|
+
|
66
|
+
return Registry._KeyItems(
|
67
|
+
self.key,
|
68
|
+
(*self.items, *items),
|
69
|
+
{**self.item_lists_by_ty, **item_lists_by_ty},
|
70
|
+
)
|
71
|
+
|
72
|
+
@dc.dataclass(frozen=True, kw_only=True)
|
73
|
+
class _State(ta.Generic[RegistryItemU]):
|
74
|
+
dct: ta.Mapping[ta.Any, 'Registry._KeyItems[RegistryItemU]']
|
75
|
+
id_dct: ta.Mapping[ta.Any, 'Registry._KeyItems[RegistryItemU]']
|
76
|
+
version: int
|
77
|
+
|
78
|
+
#
|
79
|
+
|
80
|
+
def register(
|
81
|
+
self,
|
82
|
+
key: ta.Any,
|
83
|
+
*items: RegistryItemT,
|
84
|
+
identity: bool = False,
|
85
|
+
) -> 'Registry._State[RegistryItemU]':
|
86
|
+
if not items:
|
87
|
+
return self
|
88
|
+
|
89
|
+
sr_dct: ta.Any = self.dct if not identity else self.id_dct
|
90
|
+
if (sr := sr_dct.get(key)) is None:
|
91
|
+
sr = Registry._KeyItems(key)
|
92
|
+
sr = sr.add(*items)
|
93
|
+
new = {key: sr}
|
94
|
+
|
95
|
+
return Registry._State(
|
96
|
+
dct={**self.dct, **new} if not identity else self.dct,
|
97
|
+
id_dct={**self.id_dct, **new} if identity else self.id_dct,
|
98
|
+
version=self.version + 1,
|
99
|
+
)
|
100
|
+
|
101
|
+
#
|
102
|
+
|
103
|
+
_get_cache: dict[ta.Any, ta.Sequence[RegistryItem]] = dc.field(default_factory=dict)
|
104
|
+
|
105
|
+
def get(
|
106
|
+
self,
|
107
|
+
key: ta.Any,
|
108
|
+
*,
|
109
|
+
identity: bool | None = None,
|
110
|
+
) -> ta.Sequence[RegistryItem]:
|
111
|
+
if identity is None:
|
112
|
+
try:
|
113
|
+
return self._get_cache[key]
|
114
|
+
except KeyError:
|
115
|
+
pass
|
116
|
+
|
117
|
+
ret = self._get_cache[key] = (
|
118
|
+
*self.get(key, identity=True),
|
119
|
+
*self.get(key, identity=False),
|
120
|
+
)
|
121
|
+
return ret
|
122
|
+
|
123
|
+
dct: ta.Any = self.dct if not identity else self.id_dct
|
124
|
+
try:
|
125
|
+
return dct[key].items
|
126
|
+
except KeyError:
|
127
|
+
return ()
|
128
|
+
|
129
|
+
_get_of_cache: dict[ta.Any, dict[type, ta.Sequence[RegistryItem]]] = dc.field(default_factory=dict)
|
130
|
+
|
131
|
+
def get_of(
|
132
|
+
self,
|
133
|
+
key: ta.Any,
|
134
|
+
item_ty: type[RegistryItem],
|
135
|
+
*,
|
136
|
+
identity: bool | None = None,
|
137
|
+
) -> ta.Sequence[RegistryItem]:
|
138
|
+
if identity is None:
|
139
|
+
try:
|
140
|
+
return self._get_of_cache[key][item_ty]
|
141
|
+
except KeyError:
|
142
|
+
pass
|
143
|
+
|
144
|
+
ret = self._get_of_cache.setdefault(key, {})[item_ty] = (
|
145
|
+
*self.get_of(key, item_ty, identity=True),
|
146
|
+
*self.get_of(key, item_ty, identity=False),
|
147
|
+
)
|
148
|
+
return ret
|
149
|
+
|
150
|
+
dct: ta.Any = self.dct if not identity else self.id_dct
|
151
|
+
try:
|
152
|
+
sr = dct[key]
|
153
|
+
except KeyError:
|
154
|
+
return ()
|
155
|
+
return sr.item_lists_by_ty.get(item_ty, ())
|
156
|
+
|
61
157
|
def is_sealed(self) -> bool:
|
62
158
|
if self._sealed:
|
63
159
|
return True
|
@@ -92,12 +188,11 @@ class Registry(ta.Generic[RegistryItemT]):
|
|
92
188
|
if self._sealed:
|
93
189
|
raise RegistrySealedError(self)
|
94
190
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
self._version += 1
|
191
|
+
self._state = self._state.register(
|
192
|
+
key,
|
193
|
+
*items,
|
194
|
+
identity=identity,
|
195
|
+
)
|
101
196
|
|
102
197
|
return self
|
103
198
|
|
@@ -109,17 +204,7 @@ class Registry(ta.Generic[RegistryItemT]):
|
|
109
204
|
*,
|
110
205
|
identity: bool | None = None,
|
111
206
|
) -> ta.Sequence[RegistryItem]:
|
112
|
-
|
113
|
-
return (
|
114
|
-
*self.get(key, identity=True),
|
115
|
-
*self.get(key, identity=False),
|
116
|
-
)
|
117
|
-
|
118
|
-
dct: ta.Any = self._id_dct if identity else self._dct
|
119
|
-
try:
|
120
|
-
return dct[key].items
|
121
|
-
except KeyError:
|
122
|
-
return ()
|
207
|
+
return self._state.get(key, identity=identity)
|
123
208
|
|
124
209
|
def get_of(
|
125
210
|
self,
|
@@ -128,15 +213,4 @@ class Registry(ta.Generic[RegistryItemT]):
|
|
128
213
|
*,
|
129
214
|
identity: bool | None = None,
|
130
215
|
) -> ta.Sequence[RegistryItemU]:
|
131
|
-
|
132
|
-
return (
|
133
|
-
*self.get_of(key, item_ty, identity=True),
|
134
|
-
*self.get_of(key, item_ty, identity=False),
|
135
|
-
)
|
136
|
-
|
137
|
-
dct: ta.Any = self._id_dct if identity else self._dct
|
138
|
-
try:
|
139
|
-
sr = dct[key]
|
140
|
-
except KeyError:
|
141
|
-
return ()
|
142
|
-
return sr.item_lists_by_ty.get(item_ty, ())
|
216
|
+
return self._state.get_of(key, item_ty, identity=identity) # type: ignore[return-value]
|
@@ -1,3 +1,7 @@
|
|
1
|
+
"""
|
2
|
+
TODO:
|
3
|
+
- squash literal unions - typing machinery doesn't
|
4
|
+
"""
|
1
5
|
import dataclasses as dc
|
2
6
|
import typing as ta
|
3
7
|
|
@@ -26,7 +30,7 @@ class LiteralMarshaler(Marshaler):
|
|
26
30
|
|
27
31
|
class LiteralMarshalerFactory(SimpleMarshalerFactory):
|
28
32
|
def guard(self, ctx: MarshalContext, rty: rfl.Type) -> bool:
|
29
|
-
return isinstance(rty, rfl.Literal)
|
33
|
+
return isinstance(rty, rfl.Literal) and len(set(map(type, rty.args))) == 1
|
30
34
|
|
31
35
|
def fn(self, ctx: MarshalContext, rty: rfl.Type) -> Marshaler:
|
32
36
|
lty = check.isinstance(rty, rfl.Literal)
|
@@ -45,7 +49,7 @@ class LiteralUnmarshaler(Unmarshaler):
|
|
45
49
|
|
46
50
|
class LiteralUnmarshalerFactory(SimpleUnmarshalerFactory):
|
47
51
|
def guard(self, ctx: UnmarshalContext, rty: rfl.Type) -> bool:
|
48
|
-
return isinstance(rty, rfl.Literal)
|
52
|
+
return isinstance(rty, rfl.Literal) and len(set(map(type, rty.args))) == 1
|
49
53
|
|
50
54
|
def fn(self, ctx: UnmarshalContext, rty: rfl.Type) -> Unmarshaler:
|
51
55
|
lty = check.isinstance(rty, rfl.Literal)
|
@@ -0,0 +1,213 @@
|
|
1
|
+
import typing as ta
|
2
|
+
|
3
|
+
from ... import check
|
4
|
+
from ... import collections as col
|
5
|
+
from ... import dataclasses as dc
|
6
|
+
from ... import lang
|
7
|
+
from ... import reflect as rfl
|
8
|
+
from ...funcs import match as mfs
|
9
|
+
from ..base.contexts import MarshalContext
|
10
|
+
from ..base.contexts import UnmarshalContext
|
11
|
+
from ..base.types import Marshaler
|
12
|
+
from ..base.types import Unmarshaler
|
13
|
+
from ..base.values import Value
|
14
|
+
from ..factories.simple import SimpleMarshalerFactory
|
15
|
+
from ..factories.simple import SimpleUnmarshalerFactory
|
16
|
+
|
17
|
+
|
18
|
+
##
|
19
|
+
|
20
|
+
|
21
|
+
class MatchUnionMarshaler(Marshaler):
|
22
|
+
mmf: mfs.MultiMatchFn[[UnmarshalContext, Value], ta.Any]
|
23
|
+
|
24
|
+
def marshal(self, ctx: MarshalContext, o: ta.Any) -> Value:
|
25
|
+
try:
|
26
|
+
m = self.mmf.match(ctx, o)
|
27
|
+
except mfs.AmbiguousMatchesError:
|
28
|
+
raise ValueError(o) # noqa
|
29
|
+
return m.fn(ctx, o)
|
30
|
+
|
31
|
+
|
32
|
+
class MatchUnionUnmarshaler(Unmarshaler):
|
33
|
+
mmf: mfs.MultiMatchFn[[UnmarshalContext, Value], ta.Any]
|
34
|
+
|
35
|
+
def unmarshal(self, ctx: UnmarshalContext, v: Value) -> ta.Any:
|
36
|
+
try:
|
37
|
+
m = self.mmf.match(ctx, v)
|
38
|
+
except mfs.AmbiguousMatchesError:
|
39
|
+
raise ValueError(v) # noqa
|
40
|
+
return m.fn(ctx, v)
|
41
|
+
|
42
|
+
|
43
|
+
##
|
44
|
+
|
45
|
+
|
46
|
+
PRIMITIVE_UNION_TYPES: tuple[type, ...] = (
|
47
|
+
float,
|
48
|
+
int,
|
49
|
+
str,
|
50
|
+
bool,
|
51
|
+
)
|
52
|
+
|
53
|
+
|
54
|
+
class DestructuredPrimitiveUnionType(ta.NamedTuple):
|
55
|
+
prim: ta.Sequence[type]
|
56
|
+
non_prim: ta.Sequence[rfl.Type]
|
57
|
+
|
58
|
+
|
59
|
+
def _destructure_primitive_union_type(
|
60
|
+
rty: rfl.Type,
|
61
|
+
prim_tys: ta.Container[type] = PRIMITIVE_UNION_TYPES,
|
62
|
+
) -> DestructuredPrimitiveUnionType | None:
|
63
|
+
if not isinstance(rty, rfl.Union):
|
64
|
+
return None
|
65
|
+
|
66
|
+
pr = col.partition(rty.args, lambda a: isinstance(a, type) and a in prim_tys)
|
67
|
+
if not pr.t or len(pr.f) > 1:
|
68
|
+
return None
|
69
|
+
|
70
|
+
return DestructuredPrimitiveUnionType(*pr) # type: ignore[arg-type]
|
71
|
+
|
72
|
+
|
73
|
+
#
|
74
|
+
|
75
|
+
|
76
|
+
@dc.dataclass(frozen=True)
|
77
|
+
class PrimitiveUnionMarshaler(Marshaler):
|
78
|
+
tys: ta.Sequence[type]
|
79
|
+
x: Marshaler | None = None
|
80
|
+
|
81
|
+
def marshal(self, ctx: MarshalContext, o: ta.Any) -> Value:
|
82
|
+
if type(o) not in self.tys:
|
83
|
+
if self.x is not None:
|
84
|
+
return self.x.marshal(ctx, o)
|
85
|
+
raise TypeError(o)
|
86
|
+
return o
|
87
|
+
|
88
|
+
|
89
|
+
@dc.dataclass(frozen=True)
|
90
|
+
class PrimitiveUnionMarshalerFactory(SimpleMarshalerFactory):
|
91
|
+
tys: ta.Sequence[type] = PRIMITIVE_UNION_TYPES
|
92
|
+
|
93
|
+
def guard(self, ctx: MarshalContext, rty: rfl.Type) -> bool:
|
94
|
+
return _destructure_primitive_union_type(rty, self.tys) is not None
|
95
|
+
|
96
|
+
def fn(self, ctx: MarshalContext, rty: rfl.Type) -> Marshaler:
|
97
|
+
prim, non_prim = check.not_none(_destructure_primitive_union_type(rty, self.tys))
|
98
|
+
return PrimitiveUnionMarshaler(
|
99
|
+
prim,
|
100
|
+
ctx.make(check.single(non_prim)) if non_prim else None,
|
101
|
+
)
|
102
|
+
|
103
|
+
|
104
|
+
#
|
105
|
+
|
106
|
+
|
107
|
+
@dc.dataclass(frozen=True)
|
108
|
+
class PrimitiveUnionUnmarshaler(Unmarshaler):
|
109
|
+
tys: ta.Sequence[type]
|
110
|
+
x: Unmarshaler | None = None
|
111
|
+
|
112
|
+
def unmarshal(self, ctx: UnmarshalContext, v: Value) -> ta.Any:
|
113
|
+
if type(v) not in self.tys:
|
114
|
+
if self.x is not None:
|
115
|
+
return self.x.unmarshal(ctx, v)
|
116
|
+
raise TypeError(v)
|
117
|
+
return v
|
118
|
+
|
119
|
+
|
120
|
+
@dc.dataclass(frozen=True)
|
121
|
+
class PrimitiveUnionUnmarshalerFactory(SimpleUnmarshalerFactory):
|
122
|
+
tys: ta.Sequence[type] = PRIMITIVE_UNION_TYPES
|
123
|
+
|
124
|
+
def guard(self, ctx: UnmarshalContext, rty: rfl.Type) -> bool:
|
125
|
+
return _destructure_primitive_union_type(rty, self.tys) is not None
|
126
|
+
|
127
|
+
def fn(self, ctx: UnmarshalContext, rty: rfl.Type) -> Unmarshaler:
|
128
|
+
prim, non_prim = check.not_none(_destructure_primitive_union_type(rty, self.tys))
|
129
|
+
return PrimitiveUnionUnmarshaler(
|
130
|
+
prim,
|
131
|
+
ctx.make(check.single(non_prim)) if non_prim else None,
|
132
|
+
)
|
133
|
+
|
134
|
+
|
135
|
+
##
|
136
|
+
|
137
|
+
|
138
|
+
LITERAL_UNION_TYPES: tuple[type, ...] = (
|
139
|
+
int,
|
140
|
+
str,
|
141
|
+
)
|
142
|
+
|
143
|
+
|
144
|
+
class DestructuredLiteralUnionType(ta.NamedTuple):
|
145
|
+
v_ty: type
|
146
|
+
lit: rfl.Literal
|
147
|
+
non_lit: rfl.Type
|
148
|
+
|
149
|
+
|
150
|
+
def _destructure_literal_union_type(rty: rfl.Type) -> DestructuredLiteralUnionType | None:
|
151
|
+
if not isinstance(rty, rfl.Union):
|
152
|
+
return None
|
153
|
+
lits, non_lits = col.partition(rty.args, lang.isinstance_of(rfl.Literal)) # noqa
|
154
|
+
if len(lits) != 1 or len(non_lits) != 1:
|
155
|
+
return None
|
156
|
+
lit = check.isinstance(check.single(lits), rfl.Literal)
|
157
|
+
v_tys = set(map(type, lit.args))
|
158
|
+
if len(v_tys) != 1:
|
159
|
+
return None
|
160
|
+
[v_ty] = v_tys
|
161
|
+
if v_ty in rty.args or v_ty not in LITERAL_UNION_TYPES:
|
162
|
+
return None
|
163
|
+
return DestructuredLiteralUnionType(v_ty, lit, check.single(non_lits))
|
164
|
+
|
165
|
+
|
166
|
+
#
|
167
|
+
|
168
|
+
|
169
|
+
@dc.dataclass(frozen=True)
|
170
|
+
class LiteralUnionMarshaler(Marshaler):
|
171
|
+
v_ty: type
|
172
|
+
l: Marshaler
|
173
|
+
x: Marshaler
|
174
|
+
|
175
|
+
def marshal(self, ctx: MarshalContext, o: ta.Any | None) -> Value:
|
176
|
+
if isinstance(o, self.v_ty):
|
177
|
+
return self.l.marshal(ctx, o)
|
178
|
+
else:
|
179
|
+
return self.x.marshal(ctx, o)
|
180
|
+
|
181
|
+
|
182
|
+
class LiteralUnionMarshalerFactory(SimpleMarshalerFactory):
|
183
|
+
def guard(self, ctx: MarshalContext, rty: rfl.Type) -> bool:
|
184
|
+
return _destructure_literal_union_type(rty) is not None
|
185
|
+
|
186
|
+
def fn(self, ctx: MarshalContext, rty: rfl.Type) -> Marshaler:
|
187
|
+
ds = check.not_none(_destructure_literal_union_type(rty))
|
188
|
+
return LiteralUnionMarshaler(ds.v_ty, ctx.make(ds.lit), ctx.make(ds.non_lit))
|
189
|
+
|
190
|
+
|
191
|
+
#
|
192
|
+
|
193
|
+
|
194
|
+
@dc.dataclass(frozen=True)
|
195
|
+
class LiteralUnionUnmarshaler(Unmarshaler):
|
196
|
+
v_ty: type
|
197
|
+
l: Unmarshaler
|
198
|
+
x: Unmarshaler
|
199
|
+
|
200
|
+
def unmarshal(self, ctx: UnmarshalContext, v: Value) -> ta.Any | None:
|
201
|
+
if isinstance(v, self.v_ty):
|
202
|
+
return self.l.unmarshal(ctx, v) # type: ignore[arg-type]
|
203
|
+
else:
|
204
|
+
return self.x.unmarshal(ctx, v)
|
205
|
+
|
206
|
+
|
207
|
+
class LiteralUnionUnmarshalerFactory(SimpleUnmarshalerFactory):
|
208
|
+
def guard(self, ctx: UnmarshalContext, rty: rfl.Type) -> bool:
|
209
|
+
return _destructure_literal_union_type(rty) is not None
|
210
|
+
|
211
|
+
def fn(self, ctx: UnmarshalContext, rty: rfl.Type) -> Unmarshaler:
|
212
|
+
ds = check.not_none(_destructure_literal_union_type(rty))
|
213
|
+
return LiteralUnionUnmarshaler(ds.v_ty, ctx.make(ds.lit), ctx.make(ds.non_lit))
|
@@ -43,11 +43,11 @@ class _ModuleImportingFactory(mfs.MatchFn[[ContextT, rfl.Type], R]):
|
|
43
43
|
self._callback = callback
|
44
44
|
|
45
45
|
self._lock = threading.RLock()
|
46
|
-
self.
|
46
|
+
self._last_mis: ta.Any = None
|
47
47
|
|
48
|
-
def _do_import(self, ctx: ContextT) -> None:
|
48
|
+
def _do_import(self, ctx: ContextT, mis: ta.Sequence[ModuleImport]) -> None:
|
49
49
|
c = 0
|
50
|
-
for mi in
|
50
|
+
for mi in mis:
|
51
51
|
if mi.import_if_necessary():
|
52
52
|
c += 1
|
53
53
|
|
@@ -56,13 +56,11 @@ class _ModuleImportingFactory(mfs.MatchFn[[ContextT, rfl.Type], R]):
|
|
56
56
|
self._callback()
|
57
57
|
|
58
58
|
def _import_if_necessary(self, ctx: ContextT) -> None:
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
# self._has_imported = True
|
65
|
-
self._do_import(ctx)
|
59
|
+
if (mis := ctx.config_registry.get_of(None, ModuleImport)) and mis is not self._last_mis:
|
60
|
+
with self._lock:
|
61
|
+
if (mis := ctx.config_registry.get_of(None, ModuleImport)) and mis is not self._last_mis:
|
62
|
+
self._do_import(ctx, mis)
|
63
|
+
self._last_mis = mis
|
66
64
|
|
67
65
|
def guard(self, ctx: ContextT, rty: rfl.Type) -> bool:
|
68
66
|
self._import_if_necessary(ctx)
|
@@ -107,23 +107,34 @@ class Polymorphism:
|
|
107
107
|
return self._impls
|
108
108
|
|
109
109
|
|
110
|
+
class AutoStripSuffix(lang.Marker):
|
111
|
+
pass
|
112
|
+
|
113
|
+
|
110
114
|
def polymorphism_from_impls(
|
111
115
|
ty: type,
|
112
116
|
impls: ta.Iterable[type],
|
113
117
|
*,
|
114
118
|
naming: Naming | None = None,
|
115
|
-
strip_suffix: bool |
|
119
|
+
strip_suffix: bool | type[AutoStripSuffix] | str = False,
|
116
120
|
) -> Polymorphism:
|
117
121
|
impls = set(impls)
|
118
122
|
|
119
|
-
|
123
|
+
ssx: str | None
|
124
|
+
if strip_suffix is AutoStripSuffix:
|
120
125
|
strip_suffix = all(c.__name__.endswith(ty.__name__) for c in impls)
|
126
|
+
if isinstance(strip_suffix, bool):
|
127
|
+
ssx = ty.__name__ if strip_suffix else None
|
128
|
+
elif isinstance(strip_suffix, str):
|
129
|
+
ssx = strip_suffix
|
130
|
+
else:
|
131
|
+
raise TypeError(strip_suffix)
|
121
132
|
|
122
133
|
dct: dict[str, Impl] = {}
|
123
134
|
for cur in impls:
|
124
135
|
name = cur.__name__
|
125
|
-
if
|
126
|
-
name = lang.strip_suffix(name,
|
136
|
+
if ssx is not None:
|
137
|
+
name = lang.strip_suffix(name, ssx)
|
127
138
|
if naming is not None:
|
128
139
|
name = translate_name(name, naming)
|
129
140
|
if name in dct:
|
@@ -141,7 +152,7 @@ def polymorphism_from_subclasses(
|
|
141
152
|
ty: type,
|
142
153
|
*,
|
143
154
|
naming: Naming | None = None,
|
144
|
-
strip_suffix: bool |
|
155
|
+
strip_suffix: bool | type[AutoStripSuffix] | str = False,
|
145
156
|
) -> Polymorphism:
|
146
157
|
return polymorphism_from_impls(
|
147
158
|
ty,
|
@@ -1,9 +1,13 @@
|
|
1
|
+
import typing as ta
|
2
|
+
|
1
3
|
from ..base.types import MarshalerFactory
|
2
4
|
from ..base.types import UnmarshalerFactory
|
3
5
|
from .marshal import PolymorphismMarshalerFactory
|
4
6
|
from .metadata import Polymorphism
|
5
7
|
from .metadata import TypeTagging
|
6
8
|
from .metadata import WrapperTypeTagging
|
9
|
+
from .unions import PolymorphismUnionMarshalerFactory
|
10
|
+
from .unions import PolymorphismUnionUnmarshalerFactory
|
7
11
|
from .unmarshal import PolymorphismUnmarshalerFactory
|
8
12
|
|
9
13
|
|
@@ -13,8 +17,18 @@ from .unmarshal import PolymorphismUnmarshalerFactory
|
|
13
17
|
def standard_polymorphism_factories(
|
14
18
|
poly: Polymorphism,
|
15
19
|
tt: TypeTagging = WrapperTypeTagging(),
|
16
|
-
|
17
|
-
|
20
|
+
*,
|
21
|
+
unions: bool | ta.Literal['partial'] = False,
|
22
|
+
) -> ta.Sequence[MarshalerFactory | UnmarshalerFactory]:
|
23
|
+
out: list[MarshalerFactory | UnmarshalerFactory] = [
|
18
24
|
PolymorphismMarshalerFactory(poly, tt),
|
19
25
|
PolymorphismUnmarshalerFactory(poly, tt),
|
20
|
-
|
26
|
+
]
|
27
|
+
|
28
|
+
if unions:
|
29
|
+
out.extend([
|
30
|
+
PolymorphismUnionMarshalerFactory(poly.impls, tt, allow_partial=unions == 'partial'),
|
31
|
+
PolymorphismUnionUnmarshalerFactory(poly.impls, tt, allow_partial=unions == 'partial'),
|
32
|
+
])
|
33
|
+
|
34
|
+
return out
|
@@ -1,17 +1,12 @@
|
|
1
|
-
import typing as ta
|
2
|
-
|
3
1
|
from ... import cached
|
4
2
|
from ... import check
|
5
|
-
from ... import collections as col
|
6
3
|
from ... import dataclasses as dc
|
7
4
|
from ... import lang
|
8
5
|
from ... import reflect as rfl
|
9
|
-
from ...funcs import match as mfs
|
10
6
|
from ..base.contexts import MarshalContext
|
11
7
|
from ..base.contexts import UnmarshalContext
|
12
8
|
from ..base.types import Marshaler
|
13
9
|
from ..base.types import Unmarshaler
|
14
|
-
from ..base.values import Value
|
15
10
|
from ..factories.simple import SimpleMarshalerFactory
|
16
11
|
from ..factories.simple import SimpleUnmarshalerFactory
|
17
12
|
from .marshal import make_polymorphism_marshaler
|
@@ -24,130 +19,6 @@ from .unmarshal import make_polymorphism_unmarshaler
|
|
24
19
|
##
|
25
20
|
|
26
21
|
|
27
|
-
class MatchUnionMarshaler(Marshaler):
|
28
|
-
mmf: mfs.MultiMatchFn[[UnmarshalContext, Value], ta.Any]
|
29
|
-
|
30
|
-
def marshal(self, ctx: MarshalContext, o: ta.Any) -> Value:
|
31
|
-
try:
|
32
|
-
m = self.mmf.match(ctx, o)
|
33
|
-
except mfs.AmbiguousMatchesError:
|
34
|
-
raise ValueError(o) # noqa
|
35
|
-
return m.fn(ctx, o)
|
36
|
-
|
37
|
-
|
38
|
-
class MatchUnionUnmarshaler(Unmarshaler):
|
39
|
-
mmf: mfs.MultiMatchFn[[UnmarshalContext, Value], ta.Any]
|
40
|
-
|
41
|
-
def unmarshal(self, ctx: UnmarshalContext, v: Value) -> ta.Any:
|
42
|
-
try:
|
43
|
-
m = self.mmf.match(ctx, v)
|
44
|
-
except mfs.AmbiguousMatchesError:
|
45
|
-
raise ValueError(v) # noqa
|
46
|
-
return m.fn(ctx, v)
|
47
|
-
|
48
|
-
|
49
|
-
##
|
50
|
-
|
51
|
-
|
52
|
-
PRIMITIVE_UNION_TYPES: tuple[type, ...] = (
|
53
|
-
float,
|
54
|
-
int,
|
55
|
-
str,
|
56
|
-
bool,
|
57
|
-
)
|
58
|
-
|
59
|
-
|
60
|
-
class DestructuredPrimitiveUnionType(ta.NamedTuple):
|
61
|
-
prim: ta.Sequence[type]
|
62
|
-
non_prim: ta.Sequence[rfl.Type]
|
63
|
-
|
64
|
-
|
65
|
-
def _destructure_primitive_union_type(
|
66
|
-
rty: rfl.Type,
|
67
|
-
prim_tys: ta.Container[type] = PRIMITIVE_UNION_TYPES,
|
68
|
-
) -> DestructuredPrimitiveUnionType | None:
|
69
|
-
if not isinstance(rty, rfl.Union):
|
70
|
-
return None
|
71
|
-
|
72
|
-
pr = col.partition(rty.args, lambda a: isinstance(a, type) and a in prim_tys)
|
73
|
-
if not pr.t or len(pr.f) > 1:
|
74
|
-
return None
|
75
|
-
|
76
|
-
return DestructuredPrimitiveUnionType(*pr) # type: ignore[arg-type]
|
77
|
-
|
78
|
-
|
79
|
-
#
|
80
|
-
|
81
|
-
|
82
|
-
@dc.dataclass(frozen=True)
|
83
|
-
class PrimitiveUnionMarshaler(Marshaler):
|
84
|
-
tys: ta.Sequence[type]
|
85
|
-
x: Marshaler | None = None
|
86
|
-
|
87
|
-
def marshal(self, ctx: MarshalContext, o: ta.Any) -> Value:
|
88
|
-
if type(o) not in self.tys:
|
89
|
-
if self.x is not None:
|
90
|
-
return self.x.marshal(ctx, o)
|
91
|
-
raise TypeError(o)
|
92
|
-
return o
|
93
|
-
|
94
|
-
|
95
|
-
@dc.dataclass(frozen=True)
|
96
|
-
class PrimitiveUnionMarshalerFactory(SimpleMarshalerFactory):
|
97
|
-
tys: ta.Sequence[type] = PRIMITIVE_UNION_TYPES
|
98
|
-
|
99
|
-
def guard(self, ctx: MarshalContext, rty: rfl.Type) -> bool:
|
100
|
-
return _destructure_primitive_union_type(rty, self.tys) is not None
|
101
|
-
|
102
|
-
def fn(self, ctx: MarshalContext, rty: rfl.Type) -> Marshaler:
|
103
|
-
prim, non_prim = check.not_none(_destructure_primitive_union_type(rty, self.tys))
|
104
|
-
return PrimitiveUnionMarshaler(
|
105
|
-
prim,
|
106
|
-
ctx.make(check.single(non_prim)) if non_prim else None,
|
107
|
-
)
|
108
|
-
|
109
|
-
|
110
|
-
#
|
111
|
-
|
112
|
-
|
113
|
-
@dc.dataclass(frozen=True)
|
114
|
-
class PrimitiveUnionUnmarshaler(Unmarshaler):
|
115
|
-
tys: ta.Sequence[type]
|
116
|
-
x: Unmarshaler | None = None
|
117
|
-
|
118
|
-
def unmarshal(self, ctx: UnmarshalContext, v: Value) -> ta.Any:
|
119
|
-
if type(v) not in self.tys:
|
120
|
-
if self.x is not None:
|
121
|
-
return self.x.unmarshal(ctx, v)
|
122
|
-
raise TypeError(v)
|
123
|
-
return v
|
124
|
-
|
125
|
-
|
126
|
-
@dc.dataclass(frozen=True)
|
127
|
-
class PrimitiveUnionUnmarshalerFactory(SimpleUnmarshalerFactory):
|
128
|
-
tys: ta.Sequence[type] = PRIMITIVE_UNION_TYPES
|
129
|
-
|
130
|
-
def guard(self, ctx: UnmarshalContext, rty: rfl.Type) -> bool:
|
131
|
-
return _destructure_primitive_union_type(rty, self.tys) is not None
|
132
|
-
|
133
|
-
def fn(self, ctx: UnmarshalContext, rty: rfl.Type) -> Unmarshaler:
|
134
|
-
prim, non_prim = check.not_none(_destructure_primitive_union_type(rty, self.tys))
|
135
|
-
return PrimitiveUnionUnmarshaler(
|
136
|
-
prim,
|
137
|
-
ctx.make(check.single(non_prim)) if non_prim else None,
|
138
|
-
)
|
139
|
-
|
140
|
-
|
141
|
-
#
|
142
|
-
|
143
|
-
|
144
|
-
PRIMITIVE_UNION_MARSHALER_FACTORY = PrimitiveUnionMarshalerFactory()
|
145
|
-
PRIMITIVE_UNION_UNMARSHALER_FACTORY = PrimitiveUnionUnmarshalerFactory()
|
146
|
-
|
147
|
-
|
148
|
-
##
|
149
|
-
|
150
|
-
|
151
22
|
@dc.dataclass(frozen=True)
|
152
23
|
class _BasePolymorphismUnionFactory(lang.Abstract):
|
153
24
|
impls: Impls
|
omlish/marshal/standard.py
CHANGED
@@ -22,6 +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
29
|
from .factories.invalidate import InvalidatableMarshalerFactory
|
26
30
|
from .factories.invalidate import InvalidatableUnmarshalerFactory
|
27
31
|
from .factories.moduleimport.factories import ModuleImportingMarshalerFactory
|
@@ -36,8 +40,6 @@ from .objects.dataclasses import DataclassMarshalerFactory
|
|
36
40
|
from .objects.dataclasses import DataclassUnmarshalerFactory
|
37
41
|
from .objects.namedtuples import NamedtupleMarshalerFactory
|
38
42
|
from .objects.namedtuples import NamedtupleUnmarshalerFactory
|
39
|
-
from .polymorphism.unions import PrimitiveUnionMarshalerFactory
|
40
|
-
from .polymorphism.unions import PrimitiveUnionUnmarshalerFactory
|
41
43
|
from .singular.datetimes import DATETIME_MARSHALER_FACTORY
|
42
44
|
from .singular.datetimes import DATETIME_UNMARSHALER_FACTORY
|
43
45
|
from .singular.enums import EnumMarshalerFactory
|
@@ -65,6 +67,7 @@ DEFAULT_STANDARD_FACTORIES = StandardFactories(
|
|
65
67
|
PRIMITIVE_MARSHALER_FACTORY,
|
66
68
|
NewtypeMarshalerFactory(),
|
67
69
|
OptionalMarshalerFactory(),
|
70
|
+
LiteralUnionMarshalerFactory(),
|
68
71
|
PrimitiveUnionMarshalerFactory(),
|
69
72
|
DataclassMarshalerFactory(),
|
70
73
|
NamedtupleMarshalerFactory(),
|
@@ -84,6 +87,7 @@ DEFAULT_STANDARD_FACTORIES = StandardFactories(
|
|
84
87
|
PRIMITIVE_UNMARSHALER_FACTORY,
|
85
88
|
NewtypeUnmarshalerFactory(),
|
86
89
|
OptionalUnmarshalerFactory(),
|
90
|
+
LiteralUnionUnmarshalerFactory(),
|
87
91
|
PrimitiveUnionUnmarshalerFactory(),
|
88
92
|
DataclassUnmarshalerFactory(),
|
89
93
|
NamedtupleUnmarshalerFactory(),
|
omlish/sql/queries/_marshal.py
CHANGED
@@ -92,7 +92,7 @@ def _install_standard_marshaling() -> None:
|
|
92
92
|
p = msh.polymorphism_from_subclasses(
|
93
93
|
cls,
|
94
94
|
naming=msh.Naming.SNAKE,
|
95
|
-
strip_suffix=
|
95
|
+
strip_suffix=msh.AutoStripSuffix,
|
96
96
|
)
|
97
97
|
msh.install_standard_factories(
|
98
98
|
msh.PolymorphismMarshalerFactory(p),
|
omlish/typedvalues/marshal.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
omlish/.omlish-manifests.json,sha256=FLw7xkPiSXuImZgqSP8BwrEib2R1doSzUPLUkc-QUIA,8410
|
2
|
-
omlish/__about__.py,sha256=
|
2
|
+
omlish/__about__.py,sha256=Ia-k2mCoU1psSy7-YOmB-XdT8JnxIXK5ICScX_nTpxs,3613
|
3
3
|
omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
|
4
4
|
omlish/c3.py,sha256=ZNIMl1kwg3qdei4DiUrJPQe5M81S1e76N-GuNSwLBAE,8683
|
5
5
|
omlish/cached.py,sha256=MLap_p0rdGoDIMVhXVHm1tsbcWobJF0OanoodV03Ju8,542
|
@@ -203,7 +203,7 @@ omlish/diag/lsof.py,sha256=5N5aZQ7UqEBgV-hj3_a8QcvALOeLlVb8otqF2hvucxY,9107
|
|
203
203
|
omlish/diag/procfs.py,sha256=eeB3L9UpNBpAfsax3U6OczayYboPlFzOGplqlQ4gBNY,9700
|
204
204
|
omlish/diag/procstats.py,sha256=EJEe2Zc58ykBoTfqMXro7H52aQa_pd6uC2hsIPFceso,825
|
205
205
|
omlish/diag/ps.py,sha256=MEpMU6fbkh0bSWrOHh_okOa0JDTUSUQUVSYBdh1TGvE,1672
|
206
|
-
omlish/diag/pycharm.py,sha256=
|
206
|
+
omlish/diag/pycharm.py,sha256=_WVmPm1E66cBtR4ukgUAaApe_3rX9Cv3sQRP5PL37P8,5013
|
207
207
|
omlish/diag/pydevd.py,sha256=P8izkeCEJWXFLqOWS6X8qUH3rlcfhiE07ZJOPGa5xYU,8203
|
208
208
|
omlish/diag/threads.py,sha256=sjtlTl41wxssoVCDkBB6xeLF-9kJEK3eA6hmSFWJSQA,3643
|
209
209
|
omlish/diag/timers.py,sha256=cxX3GgjTIjBx9DI4pzCCO5Hfqb1TM3uo22yim7kjfRU,3831
|
@@ -287,7 +287,7 @@ omlish/formats/toml/writer.py,sha256=9NT8sRy3I9KubxFx56Qbislvrdtbd23rEuBT-GSdUYA
|
|
287
287
|
omlish/funcs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
288
288
|
omlish/funcs/builders.py,sha256=ZSBQS2xqriXp5x0t074EEZvuTmMp4Yue2YGBoTLAioo,4044
|
289
289
|
omlish/funcs/genmachine.py,sha256=BOxO1OTjxZ7ewv_WpqYkY8bwlGQIJIjwjvYMflEFa_M,2571
|
290
|
-
omlish/funcs/match.py,sha256=
|
290
|
+
omlish/funcs/match.py,sha256=cBtG7kdpWdxvHwlte5CWlBxXSoJSV48joV4bwJJC3pk,6352
|
291
291
|
omlish/funcs/pairs.py,sha256=XhYTJdqooAJKeoGZmEaiKYeFRq5-Dj2_y92IdBl_C20,4371
|
292
292
|
omlish/funcs/pipes.py,sha256=E1dQZMBmgT2qautG1vEqy5v3QBsO2Nzryv33j4YAngA,2520
|
293
293
|
omlish/graphs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -526,28 +526,29 @@ omlish/manifests/globals.py,sha256=kVqQ-fT4kc7xWzLHoI731GviitFPv2v2yqw-p7t7Exs,2
|
|
526
526
|
omlish/manifests/loading.py,sha256=s6KnhdFQCsI2i0Rus1sMU0so2v8dUBnk59BJkSnxGt8,17514
|
527
527
|
omlish/manifests/static.py,sha256=9BaPBLkuzxHmg5A-5k9BjjBFINCdmFOIu06dMFgCfz4,497
|
528
528
|
omlish/manifests/types.py,sha256=NeOGuIVrcbqjCDbQ3MnCxxHAgHnw0CkWJsBzo230PWE,453
|
529
|
-
omlish/marshal/__init__.py,sha256=
|
529
|
+
omlish/marshal/__init__.py,sha256=HLC2svV0fqgDhAk2RJ7WWrfn7co45VwXjIZXYuYOJ6g,6340
|
530
530
|
omlish/marshal/globals.py,sha256=Q6G18hcUwUDDNnpyRPnR5Tn_XZpZCSIEXo09nYSOaNU,2236
|
531
531
|
omlish/marshal/naming.py,sha256=Mk5YrbES836_KflNNRoc5Ajd96iMYLQIMERKx1KpT4g,865
|
532
|
-
omlish/marshal/standard.py,sha256=
|
532
|
+
omlish/marshal/standard.py,sha256=UUdg74AMalPafWdQTR_kUY_n46a5G4iRo3BJfniniL8,6870
|
533
533
|
omlish/marshal/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
534
534
|
omlish/marshal/base/configs.py,sha256=y_JRghQgu8mJjPspSZcJQLhjevEuJE2kyxCdu3wGKvo,271
|
535
|
-
omlish/marshal/base/contexts.py,sha256=
|
535
|
+
omlish/marshal/base/contexts.py,sha256=yt-CNl2MH-TLiNtTQOvGU7-6AvJcwNf8ggBInKTRnbs,2292
|
536
536
|
omlish/marshal/base/errors.py,sha256=jmN3vl_U_hB6L0wAvuO7ORG27vXF7KEUk-1TxxK2mYA,308
|
537
537
|
omlish/marshal/base/funcs.py,sha256=OeSb8T3R0HZmEnAI4lOhI1HPRurTAezzV3TZWdGGK9s,1558
|
538
538
|
omlish/marshal/base/options.py,sha256=OoDErPmI0kswnqAtr7QYndlPYhIqIDarx833tKFT2R4,23
|
539
539
|
omlish/marshal/base/overrides.py,sha256=543hP4_y2JRThUOamCE0dPfgucbepVV8e_YF-_PJk6U,993
|
540
|
-
omlish/marshal/base/registries.py,sha256=
|
540
|
+
omlish/marshal/base/registries.py,sha256=NRH5X4nE_aF7vcTi4_5qqQpYbYru2Ud6aD0eKfuJ_Ws,5903
|
541
541
|
omlish/marshal/base/types.py,sha256=DBczbVhz9z9zM4uux43KUnCEJUIW_JqVNyXMxPd--Cs,2472
|
542
542
|
omlish/marshal/base/values.py,sha256=QF6OateG5kjRPHYza08wscThhg20oryf-aVQrxjfkC0,212
|
543
543
|
omlish/marshal/composite/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
544
544
|
omlish/marshal/composite/iterables.py,sha256=2VU3sh5TBKMVF1cWPXhDeuELPQzrAYovmTNHzoFLeS4,2704
|
545
|
-
omlish/marshal/composite/literals.py,sha256=
|
545
|
+
omlish/marshal/composite/literals.py,sha256=HB2uhkom3D214PqBlE2WXXu7Hjl18V65E7J2TJK-cYM,1840
|
546
546
|
omlish/marshal/composite/mappings.py,sha256=hOQ-_UZCFTqW_y70a4hNJsNsr2J9y3MYIePEymZMj94,2861
|
547
547
|
omlish/marshal/composite/maybes.py,sha256=Qy0-bxW3fC3jVvDzszNQogGwGSAwmPt61nTXP06l6cY,2273
|
548
548
|
omlish/marshal/composite/newtypes.py,sha256=KiDsuBtF7jbWk7A3wy2LAZvuaG7KJzYNF1Y0jKSOZWU,932
|
549
549
|
omlish/marshal/composite/optionals.py,sha256=A-0GUaTL5585mxdNO_FcpnP2KFmJ64MkAwMukqng2ls,1596
|
550
550
|
omlish/marshal/composite/special.py,sha256=325cEkzGw2XoMq6W0CvvO7n2Dx9I3mDsjdlZ2tN4Bfs,1402
|
551
|
+
omlish/marshal/composite/unions.py,sha256=qUVAbUS16YI1toRmq0liyuMUQSq1d2Ox5mAW0zYCdog,6058
|
551
552
|
omlish/marshal/composite/wrapped.py,sha256=xC8k21wJOpSkpAn7794hBTPBRw-HPC9sOF3WRlUh_BA,785
|
552
553
|
omlish/marshal/factories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
553
554
|
omlish/marshal/factories/invalidate.py,sha256=Jo0aGNg94LqkexVYnbwxeOscgiLC1ap_kzAgWPvRaKE,3053
|
@@ -559,7 +560,7 @@ omlish/marshal/factories/typecache.py,sha256=Q8VMGsXJMycKGIuA9NYT6h6NmcNUB8-5A_q
|
|
559
560
|
omlish/marshal/factories/typemap.py,sha256=CxScQbRw3VwILGhf38v2yOiof45YJ9p2LQhZ37SHNj8,1606
|
560
561
|
omlish/marshal/factories/moduleimport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
561
562
|
omlish/marshal/factories/moduleimport/configs.py,sha256=8g6FSPmyo0IOYSWYp5kqfJACZxL9SvzlHzrSzucNZyg,538
|
562
|
-
omlish/marshal/factories/moduleimport/factories.py,sha256=
|
563
|
+
omlish/marshal/factories/moduleimport/factories.py,sha256=6q3h8V2uOQKXZUNFnrpK2Zo2Huo920cvk6CL-W3U4gE,3198
|
563
564
|
omlish/marshal/objects/__init__.py,sha256=F4wej8L_tedC8ETYxAnmKfdPR9TjsqIus9Z3nZofYuc,182
|
564
565
|
omlish/marshal/objects/dataclasses.py,sha256=JbtI0aciUH6_eqw9qDz2O9NlbndgSvV9Cxn7SrPG7xM,9511
|
565
566
|
omlish/marshal/objects/helpers.py,sha256=hj5I1pILt3QFSVkYJNrSO3wiCaalAopEYWPL17Ip4zs,1102
|
@@ -569,9 +570,9 @@ omlish/marshal/objects/namedtuples.py,sha256=uzOZuEt2IrWtk7uyo13xaWEmFhxRQ3aKAzo
|
|
569
570
|
omlish/marshal/objects/unmarshal.py,sha256=izhtSwqSrlWSOL5uZS3naPxnfq3rhv25uUPN7_rpO08,3664
|
570
571
|
omlish/marshal/polymorphism/__init__.py,sha256=e2UTrSL0qp7w_1vkdxDWd7sXlWhep2KPV49-BB64ma8,130
|
571
572
|
omlish/marshal/polymorphism/marshal.py,sha256=ZnayCbRj3451U4py1-9dU99PHvjQuQk-ZQDGgzQjF4U,2292
|
572
|
-
omlish/marshal/polymorphism/metadata.py,sha256=
|
573
|
-
omlish/marshal/polymorphism/standard.py,sha256=
|
574
|
-
omlish/marshal/polymorphism/unions.py,sha256=
|
573
|
+
omlish/marshal/polymorphism/metadata.py,sha256=s5lNTzvP487niVorDUy6RFeTB7hde89ENgm-7I_MQg0,3622
|
574
|
+
omlish/marshal/polymorphism/standard.py,sha256=sfxKVjFG8tUam_U75_rFMY2-JSWw_l1_HBg2MrXjQHE,1096
|
575
|
+
omlish/marshal/polymorphism/unions.py,sha256=YoeDteNF3vKipGCvJDKamkykXQJ43K6R1zxM725T0YU,1963
|
575
576
|
omlish/marshal/polymorphism/unmarshal.py,sha256=8bLeI9UxUluoIqkRJSJIbdCsKkXjx3myYe9uWs16QjY,2483
|
576
577
|
omlish/marshal/singular/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
577
578
|
omlish/marshal/singular/base64.py,sha256=OZ3Ydwy64S0M-xlktYy5MagzyzTOVYayUXblq8ZK-AE,1164
|
@@ -718,7 +719,7 @@ omlish/sql/api/queries.py,sha256=OVsVqNyXXJQVDPfV3GFE2gwnHyGEenS65rTQRTNGx1Y,735
|
|
718
719
|
omlish/sql/api/resources.py,sha256=RcjnsNoyFWG0VR8YDijwuyZtnxlGQe8jiPQVl_inzIc,2266
|
719
720
|
omlish/sql/api/rows.py,sha256=Jo3AA_6Wt7tlwLO6-rp0arzYFqZXSxPudGPkW2xCYgQ,1346
|
720
721
|
omlish/sql/queries/__init__.py,sha256=qoikGQZuwDkOBwGKdUVov_Ur3I-mezSDLLdzqwRw6l8,1567
|
721
|
-
omlish/sql/queries/_marshal.py,sha256=
|
722
|
+
omlish/sql/queries/_marshal.py,sha256=dQZsDLVYipKlAZ4TvWtDgeIo4tBKDisZdN2n3C4lnnc,3004
|
722
723
|
omlish/sql/queries/base.py,sha256=nsavenCsZgzpITSI1zGEAi95K3cRDfAxRgNJKJmYul0,3502
|
723
724
|
omlish/sql/queries/binary.py,sha256=dcEzeEn104AMPuQ7QrJU2O-YCN3SUdxB5S4jaWKOUqY,2253
|
724
725
|
omlish/sql/queries/exprs.py,sha256=dG9L218QtJM1HtDYIMWqHimK03N6AL1WONk3FvVRcXY,1480
|
@@ -818,13 +819,13 @@ omlish/typedvalues/collection.py,sha256=CK4Vk9kJqAt2V8o6I4zGyv2u9DKov12uSvsGdqEd
|
|
818
819
|
omlish/typedvalues/consumer.py,sha256=lDOE-O_sgGbOvbcBg2g5ZRaV2WixnuEYxFsJBaj18oU,4690
|
819
820
|
omlish/typedvalues/generic.py,sha256=ft-x4X3k1oFirtYnDfsvrI3ZQikWM8lGLrvrOEbcGq0,742
|
820
821
|
omlish/typedvalues/holder.py,sha256=vu-umn-h1nvUqmtV5T9ZfQ_OoOYsERu8PhI2N48Ryns,1133
|
821
|
-
omlish/typedvalues/marshal.py,sha256=
|
822
|
+
omlish/typedvalues/marshal.py,sha256=TWwqiGROaQwcxglGiBt_t5D9AvlWsy3ELm7do-nPeao,4968
|
822
823
|
omlish/typedvalues/of_.py,sha256=UXkxSj504WI2UrFlqdZJbu2hyDwBhL7XVrc2qdR02GQ,1309
|
823
824
|
omlish/typedvalues/reflect.py,sha256=PAvKW6T4cW7u--iX80w3HWwZUS3SmIZ2_lQjT65uAyk,1026
|
824
825
|
omlish/typedvalues/values.py,sha256=ym46I-q2QJ_6l4UlERqv3yj87R-kp8nCKMRph0xQ3UA,1307
|
825
|
-
omlish-0.0.0.
|
826
|
-
omlish-0.0.0.
|
827
|
-
omlish-0.0.0.
|
828
|
-
omlish-0.0.0.
|
829
|
-
omlish-0.0.0.
|
830
|
-
omlish-0.0.0.
|
826
|
+
omlish-0.0.0.dev452.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
827
|
+
omlish-0.0.0.dev452.dist-info/METADATA,sha256=6HeJlCFmWua6YWGrp4v6KNC037N-n4-CEcHqBzCBUqc,19003
|
828
|
+
omlish-0.0.0.dev452.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
829
|
+
omlish-0.0.0.dev452.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
|
830
|
+
omlish-0.0.0.dev452.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
|
831
|
+
omlish-0.0.0.dev452.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|