omlish 0.0.0.dev326__py3-none-any.whl → 0.0.0.dev327__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/lang/__init__.py +8 -1
- omlish/lang/typing.py +26 -0
- {omlish-0.0.0.dev326.dist-info → omlish-0.0.0.dev327.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev326.dist-info → omlish-0.0.0.dev327.dist-info}/RECORD +9 -9
- {omlish-0.0.0.dev326.dist-info → omlish-0.0.0.dev327.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev326.dist-info → omlish-0.0.0.dev327.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev326.dist-info → omlish-0.0.0.dev327.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev326.dist-info → omlish-0.0.0.dev327.dist-info}/top_level.txt +0 -0
omlish/__about__.py
CHANGED
omlish/lang/__init__.py
CHANGED
@@ -327,10 +327,17 @@ from .sys import ( # noqa
|
|
327
327
|
|
328
328
|
from .typing import ( # noqa
|
329
329
|
BytesLike,
|
330
|
-
|
330
|
+
|
331
|
+
static_check_isinstance,
|
332
|
+
static_check_issubclass,
|
333
|
+
copy_type,
|
334
|
+
|
331
335
|
protocol_check,
|
336
|
+
|
332
337
|
typed_lambda,
|
333
338
|
typed_partial,
|
339
|
+
|
340
|
+
SequenceNotStr,
|
334
341
|
)
|
335
342
|
|
336
343
|
##
|
omlish/lang/typing.py
CHANGED
@@ -16,12 +16,38 @@ T = ta.TypeVar('T')
|
|
16
16
|
T_co = ta.TypeVar('T_co', covariant=True)
|
17
17
|
T_contra = ta.TypeVar('T_contra', contravariant=True)
|
18
18
|
|
19
|
+
# FIXME: remove? ducktyped by mypy (with memoryview)
|
19
20
|
BytesLike: ta.TypeAlias = bytes | bytearray
|
20
21
|
|
21
22
|
|
22
23
|
##
|
23
24
|
|
24
25
|
|
26
|
+
class static_check_isinstance(ta.Generic[T]): # noqa
|
27
|
+
def __init__(self, *o: T) -> None:
|
28
|
+
pass
|
29
|
+
|
30
|
+
def __call__(self, o: T) -> T:
|
31
|
+
return o
|
32
|
+
|
33
|
+
|
34
|
+
class static_check_issubclass(ta.Generic[T]): # noqa
|
35
|
+
def __init__(self, *t: type[T]) -> None:
|
36
|
+
pass
|
37
|
+
|
38
|
+
def __call__(self, t: type[T]) -> type[T]:
|
39
|
+
return t
|
40
|
+
|
41
|
+
|
42
|
+
def copy_type(o: T) -> ta.Callable[[ta.Any], T]:
|
43
|
+
"""https://github.com/python/typing/issues/769#issuecomment-903760354"""
|
44
|
+
|
45
|
+
return lambda x: x
|
46
|
+
|
47
|
+
|
48
|
+
##
|
49
|
+
|
50
|
+
|
25
51
|
def protocol_check(proto: type) -> ta.Callable[[Ty], Ty]:
|
26
52
|
def inner(cls):
|
27
53
|
if not issubclass(cls, proto):
|
@@ -1,5 +1,5 @@
|
|
1
1
|
omlish/.manifests.json,sha256=orgsRvtpHu8tdhaCvlP9v3P495OJopYYiHKjK68WtWg,8587
|
2
|
-
omlish/__about__.py,sha256=
|
2
|
+
omlish/__about__.py,sha256=d4Xjb6KLvYaunh9KWRpIDX2rC1dTJogXQi_w5nINTKg,3478
|
3
3
|
omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
|
4
4
|
omlish/c3.py,sha256=rer-TPOFDU6fYq_AWio_AmA-ckZ8JDY5shIzQ_yXfzA,8414
|
5
5
|
omlish/cached.py,sha256=MLap_p0rdGoDIMVhXVHm1tsbcWobJF0OanoodV03Ju8,542
|
@@ -404,7 +404,7 @@ omlish/iterators/iterators.py,sha256=RxW35yQ5ed8vBQ22IqpDXFx-i5JiLQdp7-pkMZXhJJ8
|
|
404
404
|
omlish/iterators/recipes.py,sha256=wOwOZg-zWG9Zc3wcAxJFSe2rtavVBYwZOfG09qYEx_4,472
|
405
405
|
omlish/iterators/tools.py,sha256=tdtWhwkPQq3sg7Brakrcbf8e1cOBg6e0TtwnSMnvEpg,2582
|
406
406
|
omlish/iterators/unique.py,sha256=Nw0pSaNEcHAkve0ugfLPvJcirDOn9ECyC5wIL8JlJKI,1395
|
407
|
-
omlish/lang/__init__.py,sha256=
|
407
|
+
omlish/lang/__init__.py,sha256=XKboOHeTokmHdfYEoSL0XZZxPGTvHiYJN7zveG-laTU,6227
|
408
408
|
omlish/lang/attrs.py,sha256=i7euRF81uNF8QDmUVXSK_BtqLGshaMi4VVdUnMjiMwg,5050
|
409
409
|
omlish/lang/casing.py,sha256=cFUlbDdXLhwnWwcYx4qnM5c4zGX7hIRUfcjiZbxUD28,4636
|
410
410
|
omlish/lang/clsdct.py,sha256=HAGIvBSbCefzRjXriwYSBLO7QHKRv2UsE78jixOb-fA,1828
|
@@ -427,7 +427,7 @@ omlish/lang/resolving.py,sha256=ei9LDyJexsMMHB9z8diUkNmynWhd_da7h7TqrMYM6lA,1611
|
|
427
427
|
omlish/lang/resources.py,sha256=WKkAddC3ctMK1bvGw-elGe8ZxAj2IaUTKVSu2nfgHTo,2839
|
428
428
|
omlish/lang/strings.py,sha256=kJmRFd1D36xXcjd9MdB12BCwF_-MVhNr-TpWj7hMi_4,4252
|
429
429
|
omlish/lang/sys.py,sha256=b4qOPiJZQru_mbb04FNfOjYWUxlV2becZOoc-yya_rQ,411
|
430
|
-
omlish/lang/typing.py,sha256=
|
430
|
+
omlish/lang/typing.py,sha256=eWI3RKhVi-_SV2rN4SGq8IbFo5XbGapbiWeduF97uG8,3846
|
431
431
|
omlish/lang/cached/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
432
432
|
omlish/lang/cached/function.py,sha256=-LSaxkpRdNZw_cuQdKspuPh1tVJrHm4qecNEGzRKnTQ,11322
|
433
433
|
omlish/lang/cached/property.py,sha256=WHYyg4-6EA86TcNMfbXTjVhjEZPc0kngt9hfY3WN5w8,2768
|
@@ -857,9 +857,9 @@ omlish/typedvalues/holder.py,sha256=ZTnHiw-K38ciOBLEdwgrltr7Xp8jjEs_0Lp69DH-G-o,
|
|
857
857
|
omlish/typedvalues/marshal.py,sha256=hWHRLcrGav7lvXJDtb9bNI0ickl4SKPQ6F4BbTpqw3A,4219
|
858
858
|
omlish/typedvalues/reflect.py,sha256=Ih1YgU-srUjsvBn_P7C66f73_VCvcwqE3ffeBnZBgt4,674
|
859
859
|
omlish/typedvalues/values.py,sha256=ym46I-q2QJ_6l4UlERqv3yj87R-kp8nCKMRph0xQ3UA,1307
|
860
|
-
omlish-0.0.0.
|
861
|
-
omlish-0.0.0.
|
862
|
-
omlish-0.0.0.
|
863
|
-
omlish-0.0.0.
|
864
|
-
omlish-0.0.0.
|
865
|
-
omlish-0.0.0.
|
860
|
+
omlish-0.0.0.dev327.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
861
|
+
omlish-0.0.0.dev327.dist-info/METADATA,sha256=mliaL7sX9zbiogrFKjPXwlZWP3vroB5tneucBGOSeHE,4416
|
862
|
+
omlish-0.0.0.dev327.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
863
|
+
omlish-0.0.0.dev327.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
|
864
|
+
omlish-0.0.0.dev327.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
|
865
|
+
omlish-0.0.0.dev327.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|