omlish 0.0.0.dev450__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 CHANGED
@@ -1,5 +1,5 @@
1
- __version__ = '0.0.0.dev450'
2
- __revision__ = '06a2dac5a7edcb1d06e2cc83c467c9b78d637e60'
1
+ __version__ = '0.0.0.dev452'
2
+ __revision__ = '85534912bc13f26aa289d4d012b6bf27695609c5'
3
3
 
4
4
 
5
5
  #
@@ -8,7 +8,7 @@ from .harness import BOOTSTRAP_TYPES_BY_NAME
8
8
 
9
9
 
10
10
  @lang.static_init
11
- def _install_standard_marshalling() -> None:
11
+ def _install_standard_marshaling() -> None:
12
12
  cfgs_poly = msh.Polymorphism(
13
13
  Bootstrap.Config,
14
14
  [msh.Impl(b.Config, n) for n, b in BOOTSTRAP_TYPES_BY_NAME.items()],
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
- stdoutToServer=True,
198
- stderrToServer=True,
212
+ **kw,
199
213
  )
omlish/diag/pydevd.py CHANGED
@@ -119,7 +119,19 @@ def _pydevd() -> types.ModuleType | None:
119
119
 
120
120
 
121
121
  def is_present() -> bool:
122
- return lang.can_import('pydevd')
122
+ # FIXME: try to use `lang.can_import('pydevd'), but raises with:
123
+ # INTERNALERROR> File "/Users/spinlock/src/wrmsr/omlish/omlish/lang/imports/resolving.py", line 16, in can_import
124
+ # INTERNALERROR> spec = importlib.util.find_spec(name, package)
125
+ # INTERNALERROR> File "<frozen importlib.util>", line 111, in find_spec
126
+ # INTERNALERROR> ValueError: pydevd.__spec__ is None
127
+ # Really want to avoid actually importing pydevd due to side-effects, slowness, and even a pkg_resources deprecation
128
+ # warning...
129
+ try:
130
+ __import__('pydevd')
131
+ except ImportError:
132
+ return False
133
+ else:
134
+ return True
123
135
 
124
136
 
125
137
  def get_setup() -> dict | None:
omlish/formats/dotenv.py CHANGED
@@ -584,7 +584,7 @@ def dotenv_values(
584
584
  For example, `foo=bar` results in `{"foo": "bar"}` whereas `foo` alone results in
585
585
  `{"foo": None}`
586
586
 
587
- Parameters:
587
+ Args:
588
588
  path: Absolute or relative path to the .env file.
589
589
  stream: `StringIO` object with .env content, used if `path` is `None`.
590
590
  verbose: Whether to output a warning if the .env file is missing.
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/lite/pycharm.py CHANGED
@@ -6,7 +6,7 @@ import typing as ta
6
6
  ##
7
7
 
8
8
 
9
- DEFAULT_PYCHARM_VERSION = '242.23726.102'
9
+ DEFAULT_PYCHARM_VERSION = '252.26199.168'
10
10
 
11
11
 
12
12
  @dc.dataclass(frozen=True)
@@ -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
@@ -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 check.not_none(self.factory).make_marshaler(self, rty)
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 check.not_none(self.factory).make_unmarshaler(self, rty)
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._dct: dict[ta.Any, _KeyRegistryItems[RegistryItemT]] = {}
54
- self._id_dct: ta.MutableMapping[ta.Any, _KeyRegistryItems[RegistryItemT]] = col.IdentityKeyDict()
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
- dct: ta.Any = self._id_dct if identity else self._dct
96
- if (sr := dct.get(key)) is None:
97
- sr = dct[key] = _KeyRegistryItems(key)
98
- sr.add(*items)
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
- if identity is None:
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
- if identity is None:
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._has_imported = False
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 ctx.config_registry.get_of(None, ModuleImport):
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
- # FIXME:
60
- # if not self._has_imported:
61
- # with self._lock:
62
- # if not self._has_imported:
63
- # self._do_import(ctx)
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 | ta.Literal['auto'] = False,
119
+ strip_suffix: bool | type[AutoStripSuffix] | str = False,
116
120
  ) -> Polymorphism:
117
121
  impls = set(impls)
118
122
 
119
- if strip_suffix == 'auto':
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 strip_suffix:
126
- name = lang.strip_suffix(name, ty.__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 | ta.Literal['auto'] = False,
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
- ) -> tuple[MarshalerFactory, UnmarshalerFactory]:
17
- return (
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,16 +1,12 @@
1
- import typing as ta
2
-
3
1
  from ... import cached
4
2
  from ... import check
5
3
  from ... import dataclasses as dc
6
4
  from ... import lang
7
5
  from ... import reflect as rfl
8
- from ...funcs import match as mfs
9
6
  from ..base.contexts import MarshalContext
10
7
  from ..base.contexts import UnmarshalContext
11
8
  from ..base.types import Marshaler
12
9
  from ..base.types import Unmarshaler
13
- from ..base.values import Value
14
10
  from ..factories.simple import SimpleMarshalerFactory
15
11
  from ..factories.simple import SimpleUnmarshalerFactory
16
12
  from .marshal import make_polymorphism_marshaler
@@ -23,98 +19,6 @@ from .unmarshal import make_polymorphism_unmarshaler
23
19
  ##
24
20
 
25
21
 
26
- class MatchUnionMarshaler(Marshaler):
27
- mmf: mfs.MultiMatchFn[[UnmarshalContext, Value], ta.Any]
28
-
29
- def marshal(self, ctx: MarshalContext, o: ta.Any) -> Value:
30
- try:
31
- m = self.mmf.match(ctx, o)
32
- except mfs.AmbiguousMatchesError:
33
- raise ValueError(o) # noqa
34
- return m.fn(ctx, o)
35
-
36
-
37
- class MatchUnionUnmarshaler(Unmarshaler):
38
- mmf: mfs.MultiMatchFn[[UnmarshalContext, Value], ta.Any]
39
-
40
- def unmarshal(self, ctx: UnmarshalContext, v: Value) -> ta.Any:
41
- try:
42
- m = self.mmf.match(ctx, v)
43
- except mfs.AmbiguousMatchesError:
44
- raise ValueError(v) # noqa
45
- return m.fn(ctx, v)
46
-
47
-
48
- ##
49
-
50
-
51
- PRIMITIVE_UNION_TYPES: tuple[type, ...] = (
52
- float,
53
- int,
54
- str,
55
- )
56
-
57
-
58
- #
59
-
60
-
61
- @dc.dataclass(frozen=True)
62
- class PrimitiveUnionMarshaler(Marshaler):
63
- tys: ta.Sequence[type]
64
-
65
- def marshal(self, ctx: MarshalContext, o: ta.Any) -> Value:
66
- if type(o) not in self.tys:
67
- raise TypeError(o)
68
- return o
69
-
70
-
71
- @dc.dataclass(frozen=True)
72
- class PrimitiveUnionMarshalerFactory(SimpleMarshalerFactory):
73
- tys: ta.Sequence[type] = PRIMITIVE_UNION_TYPES
74
-
75
- def guard(self, ctx: MarshalContext, rty: rfl.Type) -> bool:
76
- return isinstance(rty, rfl.Union) and all(a in self.tys for a in rty.args)
77
-
78
- def fn(self, ctx: MarshalContext, rty: rfl.Type) -> Marshaler:
79
- args = check.isinstance(rty, rfl.Union).args
80
- return PrimitiveUnionMarshaler([t for t in self.tys if t in args])
81
-
82
-
83
- #
84
-
85
-
86
- @dc.dataclass(frozen=True)
87
- class PrimitiveUnionUnmarshaler(Unmarshaler):
88
- tys: ta.Sequence[type]
89
-
90
- def unmarshal(self, ctx: UnmarshalContext, v: Value) -> ta.Any:
91
- if type(v) not in self.tys:
92
- raise TypeError(v)
93
- return v
94
-
95
-
96
- @dc.dataclass(frozen=True)
97
- class PrimitiveUnionUnmarshalerFactory(SimpleUnmarshalerFactory):
98
- tys: ta.Sequence[type] = PRIMITIVE_UNION_TYPES
99
-
100
- def guard(self, ctx: UnmarshalContext, rty: rfl.Type) -> bool:
101
- return isinstance(rty, rfl.Union) and all(a in self.tys for a in rty.args)
102
-
103
- def fn(self, ctx: UnmarshalContext, rty: rfl.Type) -> Unmarshaler:
104
- args = check.isinstance(rty, rfl.Union).args
105
- return PrimitiveUnionUnmarshaler([t for t in self.tys if t in args])
106
-
107
-
108
- #
109
-
110
-
111
- PRIMITIVE_UNION_MARSHALER_FACTORY = PrimitiveUnionMarshalerFactory()
112
- PRIMITIVE_UNION_UNMARSHALER_FACTORY = PrimitiveUnionUnmarshalerFactory()
113
-
114
-
115
- ##
116
-
117
-
118
22
  @dc.dataclass(frozen=True)
119
23
  class _BasePolymorphismUnionFactory(lang.Abstract):
120
24
  impls: Impls
@@ -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/secrets/marshal.py CHANGED
@@ -54,7 +54,7 @@ def marshal_secret_field(f: dc.Field) -> dc.Field:
54
54
 
55
55
 
56
56
  @lang.static_init
57
- def _install_standard_marshalling() -> None:
57
+ def _install_standard_marshaling() -> None:
58
58
  msh.install_standard_factories(
59
59
  msh.ForbiddenTypeMarshalerFactory({Secret}),
60
60
  msh.ForbiddenTypeUnmarshalerFactory({Secret}),
@@ -51,7 +51,7 @@ class NotSpecifiedUnionUnmarshalerFactory(msh.UnmarshalerFactoryMatchClass):
51
51
 
52
52
 
53
53
  @lang.static_init
54
- def _install_standard_marshalling() -> None:
54
+ def _install_standard_marshaling() -> None:
55
55
  msh.install_standard_factories(
56
56
  msh.ForbiddenTypeMarshalerFactory({_NOT_SPECIFIED_RTY}),
57
57
  msh.ForbiddenTypeUnmarshalerFactory({_NOT_SPECIFIED_RTY}),
@@ -22,7 +22,7 @@ class _KeywordsUnmarshaler(msh.Unmarshaler):
22
22
 
23
23
 
24
24
  @lang.static_init
25
- def _install_standard_marshalling() -> None:
25
+ def _install_standard_marshaling() -> None:
26
26
  msh.install_standard_factories(
27
27
  msh.TypeMapMarshalerFactory({Keywords: _KeywordsMarshaler()}),
28
28
  msh.TypeMapUnmarshalerFactory({Keywords: _KeywordsUnmarshaler()}),
@@ -138,7 +138,7 @@ class _SchemaUnmarshalerFactory(msh.UnmarshalerFactoryMatchClass):
138
138
 
139
139
 
140
140
  @lang.static_init
141
- def _install_standard_marshalling() -> None:
141
+ def _install_standard_marshaling() -> None:
142
142
  msh.install_standard_factories(
143
143
  _ReferenceUnionMarshalerFactory(),
144
144
  _ReferenceUnionUnmarshalerFactory(),
@@ -63,7 +63,7 @@ class LowerEnumMarshaler(msh.Marshaler, msh.Unmarshaler):
63
63
 
64
64
 
65
65
  @lang.static_init
66
- def _install_standard_marshalling() -> None:
66
+ def _install_standard_marshaling() -> None:
67
67
  for ty, ns in [
68
68
  (BinaryOp, BinaryOps),
69
69
  (UnaryOp, UnaryOps),
@@ -92,7 +92,7 @@ def _install_standard_marshalling() -> None:
92
92
  p = msh.polymorphism_from_subclasses(
93
93
  cls,
94
94
  naming=msh.Naming.SNAKE,
95
- strip_suffix='auto',
95
+ strip_suffix=msh.AutoStripSuffix,
96
96
  )
97
97
  msh.install_standard_factories(
98
98
  msh.PolymorphismMarshalerFactory(p),
@@ -16,6 +16,6 @@ def _install_poly(cls: type) -> None:
16
16
 
17
17
 
18
18
  @lang.static_init
19
- def _install_standard_marshalling() -> None:
19
+ def _install_standard_marshaling() -> None:
20
20
  _install_poly(Dtype)
21
21
  _install_poly(Element)
@@ -19,7 +19,7 @@ def _build_typed_value_poly(rty: rfl.Type) -> msh.Polymorphism:
19
19
  return msh.polymorphism_from_subclasses(
20
20
  ty,
21
21
  naming=msh.Naming.SNAKE,
22
- strip_suffix='auto',
22
+ strip_suffix=msh.AutoStripSuffix,
23
23
  )
24
24
 
25
25
 
@@ -144,7 +144,7 @@ class TypedValuesUnmarshalerFactory(msh.UnmarshalerFactoryMatchClass):
144
144
 
145
145
 
146
146
  @lang.static_init
147
- def _install_standard_marshalling() -> None:
147
+ def _install_standard_marshaling() -> None:
148
148
  msh.install_standard_factories(
149
149
  TypedValueMarshalerFactory(),
150
150
  TypedValueUnmarshalerFactory(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omlish
3
- Version: 0.0.0.dev450
3
+ Version: 0.0.0.dev452
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License-Expression: BSD-3-Clause
@@ -1,5 +1,5 @@
1
1
  omlish/.omlish-manifests.json,sha256=FLw7xkPiSXuImZgqSP8BwrEib2R1doSzUPLUkc-QUIA,8410
2
- omlish/__about__.py,sha256=pAgRECTFzk0v1aWP_EMCioDMp_FL4IXyuUAF95ZEw0Q,3613
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
@@ -48,7 +48,7 @@ omlish/asyncs/ioproxy/proxy.py,sha256=TmWNQb7iOKyEk8ZOG2gZuk0RhziymwypWblZQ5u2QS
48
48
  omlish/asyncs/ioproxy/typing.py,sha256=ZM-9HRO4dpy-RqomSkyRha9s901ckL30bwjACi2TJ8s,2475
49
49
  omlish/bootstrap/__init__.py,sha256=svuRMcY-rqA31fLnHpTRRAs1uN63MXIeGcKK3NoKhL0,691
50
50
  omlish/bootstrap/__main__.py,sha256=GKhsZdPdJtzE4qnjt34-EvL07nLJVZD-d8nxfGl7EEI,188
51
- omlish/bootstrap/_marshal.py,sha256=aKLeiOyPW6DelVK78dmw0axQzOMHX-ALrSqOOzYh05w,486
51
+ omlish/bootstrap/_marshal.py,sha256=FF2sUEoLZyQ55F53hLmoeox6Y24XJuKryZXAIth-nJs,485
52
52
  omlish/bootstrap/base.py,sha256=K9CaPlVO7X5dsvmEp-lZw32Ud52K0DoEbPIWGB7Hgcs,1075
53
53
  omlish/bootstrap/diag.py,sha256=nTHKrZBdyEYoTpctwOpwzSMbQ2dROGkxpdzWfoe2xZg,5353
54
54
  omlish/bootstrap/harness.py,sha256=qPYW7CXUdLi-a3BK6GvbdAPb91j5IiRlBPcXCjRGzZo,1995
@@ -203,8 +203,8 @@ 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=9Mgn5T2ZdlEUL3VV-GzVmCBs_ZtIpLwaUzP6pgHEUEo,4712
207
- omlish/diag/pydevd.py,sha256=4_tKEwjj2tUL3DMNdB1IXZ-zKZjTJd6o75kL0JKEZAk,7593
206
+ omlish/diag/pycharm.py,sha256=_WVmPm1E66cBtR4ukgUAaApe_3rX9Cv3sQRP5PL37P8,5013
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
210
210
  omlish/diag/_pycharm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -237,7 +237,7 @@ omlish/formats/__init__.py,sha256=T0AG1gFnqQ5JiHN0UPQjQ-7g5tnxMIG-mgOvMYExYAM,21
237
237
  omlish/formats/cbor.py,sha256=o_Hbe4kthO9CeXK-FySrw0dHVlrdyTo2Y8PpGRDfZ3c,514
238
238
  omlish/formats/cloudpickle.py,sha256=16si4yUp_pAdDWGECAWf6HLA2PwSANGGgDoMLGZUem8,579
239
239
  omlish/formats/codecs.py,sha256=n_02fv1Qk2ixG9vDkTZKdRHGWPKnvDBDdOMVKfnElOI,1641
240
- omlish/formats/dotenv.py,sha256=2BjwqsgLgXCmvyNeWq6_xigfH4OIcIoaJbYIuVmul5E,19351
240
+ omlish/formats/dotenv.py,sha256=nDLVPtWHsJaPWKv9Nl8IXSg2R6fayH40nUEBg_7Ozoc,19345
241
241
  omlish/formats/logfmt.py,sha256=i_pKnzFFyNAcPiqC4FiTYPC6tJujlaGuw94V2YNVkf8,2639
242
242
  omlish/formats/pickle.py,sha256=jdp4E9WH9qVPBE3sSqbqDtUo18RbTSIiSpSzJ-IEVZw,529
243
243
  omlish/formats/props.py,sha256=orlqpFG88hL39apzaAOHmNooQv-kbnXX2WggZjdI-U8,18934
@@ -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=AD0sQs_GIRq--fIQzL5gFYzlvXHplIljvlx7hbhNSEk,6213
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
@@ -481,7 +481,7 @@ omlish/lite/marshal.py,sha256=oVqVwqTArFUj9lYhmKg_MVgnqlCAUvOnYgtU3bBu_bk,23020
481
481
  omlish/lite/maybes.py,sha256=sJ4dawgBxlZ4oB9dZ3bhBb_8AOJlIW0nVIFgFZ1huXE,4384
482
482
  omlish/lite/maysync.py,sha256=Otd-xqWaMzY9xBF5SiLKxu4kG_GaWGk8qTGFDAHXDm4,14803
483
483
  omlish/lite/objects.py,sha256=HzN_4J6w6WDLKDrW8jSNUKgfAR5vUsB42rtSCu04oqQ,1921
484
- omlish/lite/pycharm.py,sha256=FRHGcCDo42UzZXqNwW_DkhI-6kb_CmJKPiQ8F6mYkLA,1174
484
+ omlish/lite/pycharm.py,sha256=fdSTwtdqGRL0P9IkCrDAPqQkJsegq1NfYyVG2N6cy4w,1174
485
485
  omlish/lite/reflect.py,sha256=aTRQJ-hgnyRxr0dFxivUTScmUgP7zcw_iDQZIsarG24,2119
486
486
  omlish/lite/resources.py,sha256=YNSmX1Ohck1aoWRs55a-o5ChVbFJIQhtbqE-XwF55Oc,326
487
487
  omlish/lite/runtime.py,sha256=J59skBq9kwo1H2s36jAk-k87eKPUtua6CmuXh-3dgmE,464
@@ -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=uzPPSRIamgMa0syMbY1I_2YJApaABNeDczBmrgm8j7I,6203
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=6L4FK7QVgVFAf2jkTQlCvN-15DWK49VCNlNwCBea3-8,6674
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=greDE5d4xHrY7NWTSwEgrBh_BSeALAqBqx2-xcAMoIg,2256
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=CHxjr2VPEwh2NwmnCB17AMY3YE9mWT9kUtPNiyTzGM8,3416
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=pXngZKSaZ4f-ANr43AsU1ob_Rj7KTjZRQQvNjdMCKRc,1696
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=LpiH27t6O8x1x-j9v2P5vD8H9TABgVS8Xe9xE4yPGRg,3136
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=c-sOVGvV96OqMfdXUVcVXK8u4xtxHjdHJFXmUx7Km40,3327
573
- omlish/marshal/polymorphism/standard.py,sha256=6wwFFwL9fTwIDqhynZr05naL8gVNC_RnPux-8vmja8o,587
574
- omlish/marshal/polymorphism/unions.py,sha256=AWNyzETvgADOjPmXsHloXgbvjZ4GX9b_iNmD6ZdXsT0,4445
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
@@ -627,7 +628,7 @@ omlish/reflect/types.py,sha256=4Plo_1cHIk8-68lu8_c_SUEohy19exTNDsgvuVbOJ5A,16066
627
628
  omlish/secrets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
628
629
  omlish/secrets/all.py,sha256=qBxUFIqxCExADL71taNH_W6FYT9QvOrdcaMeUUPO3aw,298
629
630
  omlish/secrets/crypto.py,sha256=q0Hca5oMwvh39r0hrupN_ewxhlllbdDgAgVoloYFmDg,3714
630
- omlish/secrets/marshal.py,sha256=u90n1OfRfdpH1T2F0xK_pAPH1ENYL6acFt6XdVd3KvI,1986
631
+ omlish/secrets/marshal.py,sha256=RmafPrkmSnO4YEjwLI21z1XQirdg55WMJ8U7zdJ_BqA,1985
631
632
  omlish/secrets/openssl.py,sha256=4zp1KZ1EVRNaBS0VIokTqnamy3ZeeC1XN2wSXx4lEcM,6215
632
633
  omlish/secrets/pwgen.py,sha256=Z5i1qMKK4idOZvWai5dXkI59gX7pYzFFlFYAj7qEmqA,1706
633
634
  omlish/secrets/pwhash.py,sha256=Jctv3QzcMvVPXJsWA3w3LDUlzmyUDGEWG9sLiJz1xaw,4107
@@ -660,12 +661,12 @@ omlish/specs/jmespath/parser.py,sha256=uNk9_xQ9cZJC1h5naoH1HMbCs4B0WhV2jN5AvhdKT
660
661
  omlish/specs/jmespath/scope.py,sha256=gsVjmAVF0b7s2SevWb0rBbURayiMSIuXfzO4v1ONIrY,1595
661
662
  omlish/specs/jmespath/visitor.py,sha256=6OCi7oa4IsGW5fCqAeFuXYEwn-aLKuMrNMFtQKSpJWo,16951
662
663
  omlish/specs/jsonrpc/__init__.py,sha256=u2kcJeo6YWEvFYf7OqDNKThszGLSmXYFNJpqXmXgm1M,504
663
- omlish/specs/jsonrpc/_marshal.py,sha256=LJ6V6O7iFIfQx5-DeP7GN23Ao_amThECnntqlBv8c2Y,1857
664
+ omlish/specs/jsonrpc/_marshal.py,sha256=I4mw9uGwrlNe5xXoJixpefPuP-fh2QiDZsTBI4gAQZI,1856
664
665
  omlish/specs/jsonrpc/conns.py,sha256=zvWnBHuSoGnvbGVk72Usp4IFsLscrzPozqR2hmFjnDI,7029
665
666
  omlish/specs/jsonrpc/errors.py,sha256=WxEU7k1TqeZAo_H6eU0LcrXSd-Gi_3fTvtxjXZ9qKww,712
666
667
  omlish/specs/jsonrpc/types.py,sha256=Se9ecG-_k-kY_Qlt9QD2t3y26oY4sXTcskp6XZfVans,3054
667
668
  omlish/specs/jsonschema/__init__.py,sha256=12JNHdvV-LN0d0Ir80Ch8msVb4JqGSjB0wLSwW1oN2U,1187
668
- omlish/specs/jsonschema/_marshal.py,sha256=-pmBtNnKC0sxGg3TMVWngTbSSAwG1zQyt0D6aZutd84,873
669
+ omlish/specs/jsonschema/_marshal.py,sha256=LTIMWdBkBQ_1gdVwTszfPu9wIrPYbdG2MGts1bbLFqM,872
669
670
  omlish/specs/jsonschema/types.py,sha256=_H7ma99hD3_Xu42BFGHOXRI5p79tY8WBX8QE36k7lbw,472
670
671
  omlish/specs/jsonschema/keywords/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
671
672
  omlish/specs/jsonschema/keywords/base.py,sha256=_O_VZySO5j5vnEiQWojk3zwaj7OQowT0e6bk3UYDTeM,3011
@@ -690,7 +691,7 @@ omlish/specs/jsonschema/schemas/draft202012/vocabularies/meta-data.json,sha256=j
690
691
  omlish/specs/jsonschema/schemas/draft202012/vocabularies/unevaluated.json,sha256=Lb-8tzmUtnCwl2SSre4f_7RsIWgnhNL1pMpWH54tDLQ,506
691
692
  omlish/specs/jsonschema/schemas/draft202012/vocabularies/validation.json,sha256=cBCjHlQfMtK-ch4t40jfdcmzaHaj7TBId_wKvaHTelg,2834
692
693
  omlish/specs/openapi/__init__.py,sha256=KS7OHPBlXwBeTvmsUQy0VMzKYdz2RyH3qLF3bU0NXUw,147
693
- omlish/specs/openapi/_marshal.py,sha256=6CB2LCwFfU5rstqkgN_j4Z5rbnba2glzOxcSd01uffI,4451
694
+ omlish/specs/openapi/_marshal.py,sha256=PYx4Jj8bxnimUwuFi6Y5-Nj1HternkSSx-Rovn-Wp2k,4450
694
695
  omlish/specs/openapi/openapi.py,sha256=6KGY_d8HOyG7ssHIWM40MCXgIMzNLiLKHYNggTSpAYM,12027
695
696
  omlish/sql/__init__.py,sha256=JjgIiP2YfiHHIANP7qgkJUG0IMIRzzvKntyhdDKeNdY,384
696
697
  omlish/sql/abc.py,sha256=3hrCjB4jnPVMef_YXClCblzYUZ9l9yaxJJdd5_Nu9GM,4043
@@ -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=PwfcCmf-qeKsiL61c_GjUID6flLCiDiltFndPBhQIAM,2992
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
@@ -736,7 +737,7 @@ omlish/sql/queries/stmts.py,sha256=pBqwD7dRlqMu6uh6vR3xaWOEgbZCcFWbOQ9ryYd17T4,4
736
737
  omlish/sql/queries/unary.py,sha256=MEYBDZn_H0bexmUrJeONOv5-gIpYowUaXOsEHeQM4ks,1144
737
738
  omlish/sql/queries/unions.py,sha256=w9lKrQ38nMme_gyDPciZNqyCBhwFkLusc9fjmBDu48U,438
738
739
  omlish/sql/tabledefs/__init__.py,sha256=eFaO_QQaEv4Z9CLxFSzZgmXqxPI7xKTpDI6outo1VPk,150
739
- omlish/sql/tabledefs/_marshal.py,sha256=5Z7K433SzfN7-z8Yd7FJRzOV9tJv-ErRMA6inZ2iBCE,475
740
+ omlish/sql/tabledefs/_marshal.py,sha256=1yV2xDNX9iDY1y8QYj1CBDHwlqO6v4xEwDeSGyluMKc,474
740
741
  omlish/sql/tabledefs/dtypes.py,sha256=X0N6Y1c2bQ4HC0WA-Yv_jZPvGlSqO7hMIV-towDw3MU,367
741
742
  omlish/sql/tabledefs/elements.py,sha256=lP_Ch19hKmiGYPQVeC8HpFaKdTYnXi2FfpfwKMxZOck,1674
742
743
  omlish/sql/tabledefs/lower.py,sha256=i4_QkVlVH5U99O6pqokrB661AudNVJ9Q-OwtkKOBleU,1410
@@ -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=AtBz7Jq-BfW8vwM7HSxSpR85JAXmxK2T0xDblmm1HI0,4956
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.dev450.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
826
- omlish-0.0.0.dev450.dist-info/METADATA,sha256=DwUHc-Z09a7IkYIMSrhnyjgwyNUGM9xvFiLSCEQsIXs,19003
827
- omlish-0.0.0.dev450.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
828
- omlish-0.0.0.dev450.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
829
- omlish-0.0.0.dev450.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
830
- omlish-0.0.0.dev450.dist-info/RECORD,,
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,,