omlish 0.0.0.dev44__py3-none-any.whl → 0.0.0.dev45__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/descriptors.py +2 -2
- omlish/reflect/__init__.py +1 -0
- omlish/reflect/types.py +18 -8
- omlish/specs/__init__.py +2 -1
- {omlish-0.0.0.dev44.dist-info → omlish-0.0.0.dev45.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev44.dist-info → omlish-0.0.0.dev45.dist-info}/RECORD +11 -11
- {omlish-0.0.0.dev44.dist-info → omlish-0.0.0.dev45.dist-info}/LICENSE +0 -0
- {omlish-0.0.0.dev44.dist-info → omlish-0.0.0.dev45.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev44.dist-info → omlish-0.0.0.dev45.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev44.dist-info → omlish-0.0.0.dev45.dist-info}/top_level.txt +0 -0
omlish/__about__.py
CHANGED
omlish/lang/descriptors.py
CHANGED
@@ -220,8 +220,8 @@ class AccessForbiddenDescriptor:
|
|
220
220
|
raise AccessForbiddenError(self._name)
|
221
221
|
|
222
222
|
|
223
|
-
def access_forbidden(): # noqa
|
224
|
-
return AccessForbiddenDescriptor()
|
223
|
+
def access_forbidden(name=None): # noqa
|
224
|
+
return AccessForbiddenDescriptor(name)
|
225
225
|
|
226
226
|
|
227
227
|
##
|
omlish/reflect/__init__.py
CHANGED
omlish/reflect/types.py
CHANGED
@@ -61,6 +61,17 @@ _KNOWN_SPECIAL_TYPE_VARS = tuple(
|
|
61
61
|
##
|
62
62
|
|
63
63
|
|
64
|
+
_SIMPLE_GENERIC_ALIAS_TYPES: set[type] = set()
|
65
|
+
|
66
|
+
|
67
|
+
def is_simple_generic_alias_type(oty: type) -> bool:
|
68
|
+
return (
|
69
|
+
oty is _GenericAlias or
|
70
|
+
oty is ta.GenericAlias or # type: ignore # noqa
|
71
|
+
oty in _SIMPLE_GENERIC_ALIAS_TYPES
|
72
|
+
)
|
73
|
+
|
74
|
+
|
64
75
|
def get_params(obj: ta.Any) -> tuple[ta.TypeVar, ...]:
|
65
76
|
if isinstance(obj, type):
|
66
77
|
if issubclass(obj, ta.Generic): # type: ignore
|
@@ -71,10 +82,7 @@ def get_params(obj: ta.Any) -> tuple[ta.TypeVar, ...]:
|
|
71
82
|
|
72
83
|
oty = type(obj)
|
73
84
|
|
74
|
-
if (
|
75
|
-
oty is _GenericAlias or
|
76
|
-
oty is ta.GenericAlias # type: ignore # noqa
|
77
|
-
):
|
85
|
+
if is_simple_generic_alias_type(oty):
|
78
86
|
return obj.__dict__.get('__parameters__', ()) # noqa
|
79
87
|
|
80
88
|
if oty is _CallableGenericAlias:
|
@@ -91,6 +99,10 @@ def is_union_type(cls: ta.Any) -> bool:
|
|
91
99
|
return ta.get_origin(cls) in {ta.Union}
|
92
100
|
|
93
101
|
|
102
|
+
def get_orig_bases(obj: ta.Any) -> ta.Any:
|
103
|
+
return obj.__orig_bases__ # noqa
|
104
|
+
|
105
|
+
|
94
106
|
def get_orig_class(obj: ta.Any) -> ta.Any:
|
95
107
|
return obj.__orig_class__ # noqa
|
96
108
|
|
@@ -195,8 +207,7 @@ def is_type(obj: ta.Any) -> bool:
|
|
195
207
|
isinstance(obj, ta.NewType) or # noqa
|
196
208
|
|
197
209
|
(
|
198
|
-
oty
|
199
|
-
oty is ta.GenericAlias or # type: ignore # noqa
|
210
|
+
is_simple_generic_alias_type(oty) or
|
200
211
|
oty is _CallableGenericAlias
|
201
212
|
) or
|
202
213
|
|
@@ -222,8 +233,7 @@ def type_(obj: ta.Any) -> Type:
|
|
222
233
|
return NewType(obj)
|
223
234
|
|
224
235
|
if (
|
225
|
-
oty
|
226
|
-
oty is ta.GenericAlias or # type: ignore # noqa
|
236
|
+
is_simple_generic_alias_type(oty) or
|
227
237
|
oty is _CallableGenericAlias
|
228
238
|
):
|
229
239
|
origin = ta.get_origin(obj)
|
omlish/specs/__init__.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
omlish/.manifests.json,sha256=FPSgLg_3QDVzKlNOuqV3dMqhja2KG_TUfKdGmHE8Eg4,803
|
2
|
-
omlish/__about__.py,sha256=
|
2
|
+
omlish/__about__.py,sha256=ksJohON1-moGxasw7d_K1YOOVRTb4318HQNolEuZ3zo,2919
|
3
3
|
omlish/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
omlish/argparse.py,sha256=Vr70_85EVLJLgEkRtwOr264tMRtqtlN7ncFfXRUk5aM,6914
|
5
5
|
omlish/c3.py,sha256=4vogWgwPb8TbNS2KkZxpoWbwjj7MuHG2lQG-hdtkvjI,8062
|
@@ -174,7 +174,7 @@ omlish/lang/clsdct.py,sha256=AjtIWLlx2E6D5rC97zQ3Lwq2SOMkbg08pdO_AxpzEHI,1744
|
|
174
174
|
omlish/lang/cmp.py,sha256=5vbzWWbqdzDmNKAGL19z6ZfUKe5Ci49e-Oegf9f4BsE,1346
|
175
175
|
omlish/lang/contextmanagers.py,sha256=NEwaTLQMfhKawD5x_0HgI2RpeLXbMa5r9NqWqfDnUXI,10408
|
176
176
|
omlish/lang/datetimes.py,sha256=ehI_DhQRM-bDxAavnp470XcekbbXc4Gdw9y1KpHDJT0,223
|
177
|
-
omlish/lang/descriptors.py,sha256=
|
177
|
+
omlish/lang/descriptors.py,sha256=tszC_fMICqCz1cUXejJ4beWzt6DlIBulknJFRkSTZp4,6615
|
178
178
|
omlish/lang/exceptions.py,sha256=qJBo3NU1mOWWm-NhQUHCY5feYXR3arZVyEHinLsmRH4,47
|
179
179
|
omlish/lang/functions.py,sha256=kkPfcdocg-OmyN7skIqrFxNvqAv89Zc_kXKYAN8vw8g,3895
|
180
180
|
omlish/lang/imports.py,sha256=04ugFC8NI5sbL7NH4V0r0q_nFsP_AMkHLz697CVkMtQ,6274
|
@@ -250,11 +250,11 @@ omlish/math/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
250
250
|
omlish/math/bits.py,sha256=yip1l8agOYzT7bFyMGc0RR3XlnGCfHMpjw_SECLLh1I,3477
|
251
251
|
omlish/math/floats.py,sha256=UimhOT7KRl8LXTzOI5cQWoX_9h6WNWe_3vcOuO7-h_8,327
|
252
252
|
omlish/math/stats.py,sha256=MegzKVsmv2kra4jDWLOUgV0X7Ee2Tbl5u6ql1v4-dEY,10053
|
253
|
-
omlish/reflect/__init__.py,sha256=
|
253
|
+
omlish/reflect/__init__.py,sha256=8t2955chuWPzj8yiV7R_jlREAezSz6CVTJ0HKY58Vpk,687
|
254
254
|
omlish/reflect/isinstance.py,sha256=x5T9S2634leinBT4hl3CZZkRttvdvvlxChkC_x9Qu2s,1176
|
255
255
|
omlish/reflect/ops.py,sha256=RJ6jzrM4ieFsXzWyNXWV43O_WgzEaUvlHSc5N2ezW2A,2044
|
256
256
|
omlish/reflect/subst.py,sha256=JM2RGv2-Rcex8wCqhmgvRG59zD242P9jM3O2QLjKWWo,3586
|
257
|
-
omlish/reflect/types.py,sha256=
|
257
|
+
omlish/reflect/types.py,sha256=Zkcp8nx_vFNH7pBZ5pU5P0wIgQCauj5Nic3BZb5cRik,7030
|
258
258
|
omlish/secrets/__init__.py,sha256=VKB2IF9vz4h4RXcZxgXj36KXOLcGBzfqVnxPgPDWpmg,408
|
259
259
|
omlish/secrets/crypto.py,sha256=6CsLy0UEqCrBK8Xx_3-iFF6SKtu2GlEqUQ8-MliY3tk,3709
|
260
260
|
omlish/secrets/marshal.py,sha256=U9uSRTWzZmumfNZeh_dROwVdGrARsp155TylRbjilP8,2048
|
@@ -262,7 +262,7 @@ omlish/secrets/openssl.py,sha256=wxA_wIlxtuOUy71ABxAJgavh-UI_taOfm-A0dVlmSwM,621
|
|
262
262
|
omlish/secrets/passwords.py,sha256=3r-vEK6Gp6aq4L5Csnd06QnrjO9xfzHJP-g_7I9W_ao,4101
|
263
263
|
omlish/secrets/secrets.py,sha256=ClD7t_mkmWkseVk4ahLzYLuLXeTxiwwPiidYm42vLh4,6871
|
264
264
|
omlish/secrets/subprocesses.py,sha256=EcnKlHHtnUMHGrBWXDfu8tv28wlgZx4P4GOiuPW9Vo8,1105
|
265
|
-
omlish/specs/__init__.py,sha256=
|
265
|
+
omlish/specs/__init__.py,sha256=R5X62_Iur9gg_gWLWJCgjSK_zec76g15agYPLNgwfGc,99
|
266
266
|
omlish/specs/jsonrpc/__init__.py,sha256=E0EogYSKmbj1D-V57tBgPDTyVuD8HosHqVg0Vh1CVwM,416
|
267
267
|
omlish/specs/jsonrpc/errors.py,sha256=-Zgmlo6bV6J8w5f8h9axQgLquIFBHDgIwcpufEH5NsE,707
|
268
268
|
omlish/specs/jsonrpc/marshal.py,sha256=iXZNR7n0vfL_yiPFFYN-ZyGlzknNXExs2qC1HFChGPU,1913
|
@@ -328,9 +328,9 @@ omlish/text/delimit.py,sha256=ubPXcXQmtbOVrUsNh5gH1mDq5H-n1y2R4cPL5_DQf68,4928
|
|
328
328
|
omlish/text/glyphsplit.py,sha256=Ug-dPRO7x-OrNNr8g1y6DotSZ2KH0S-VcOmUobwa4B0,3296
|
329
329
|
omlish/text/indent.py,sha256=6Jj6TFY9unaPa4xPzrnZemJ-fHsV53IamP93XGjSUHs,1274
|
330
330
|
omlish/text/parts.py,sha256=7vPF1aTZdvLVYJ4EwBZVzRSy8XB3YqPd7JwEnNGGAOo,6495
|
331
|
-
omlish-0.0.0.
|
332
|
-
omlish-0.0.0.
|
333
|
-
omlish-0.0.0.
|
334
|
-
omlish-0.0.0.
|
335
|
-
omlish-0.0.0.
|
336
|
-
omlish-0.0.0.
|
331
|
+
omlish-0.0.0.dev45.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
332
|
+
omlish-0.0.0.dev45.dist-info/METADATA,sha256=Wgmc5z7G_7Nqo7dCn6hUlxya_-xb7yRNAy9kFr16xC0,3817
|
333
|
+
omlish-0.0.0.dev45.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
334
|
+
omlish-0.0.0.dev45.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
|
335
|
+
omlish-0.0.0.dev45.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
|
336
|
+
omlish-0.0.0.dev45.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|