jetpytools 1.2.8__py3-none-any.whl → 1.4.0__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.
Potentially problematic release.
This version of jetpytools might be problematic. Click here for more details.
- jetpytools/_metadata.py +1 -1
- jetpytools/enums/base.py +1 -5
- jetpytools/exceptions/base.py +3 -13
- jetpytools/types/builtins.py +8 -7
- jetpytools/types/utils.py +65 -111
- {jetpytools-1.2.8.dist-info → jetpytools-1.4.0.dist-info}/METADATA +3 -1
- {jetpytools-1.2.8.dist-info → jetpytools-1.4.0.dist-info}/RECORD +10 -10
- {jetpytools-1.2.8.dist-info → jetpytools-1.4.0.dist-info}/WHEEL +1 -1
- {jetpytools-1.2.8.dist-info → jetpytools-1.4.0.dist-info}/licenses/LICENSE +0 -0
- {jetpytools-1.2.8.dist-info → jetpytools-1.4.0.dist-info}/top_level.txt +0 -0
jetpytools/_metadata.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Collection of stuff that's useful in general python programming"""
|
|
2
2
|
|
|
3
|
-
__version__ = '1.
|
|
3
|
+
__version__ = '1.4.0'
|
|
4
4
|
|
|
5
5
|
__author_name__, __author_email__ = 'Jaded Encoding Thaumaturgy', 'jaded.encoding.thaumaturgy@gmail.com'
|
|
6
6
|
__maintainer_name__, __maintainer_email__ = __author_name__, __author_email__
|
jetpytools/enums/base.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from enum import Enum
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
6
|
from typing_extensions import Self
|
|
7
7
|
|
|
@@ -9,7 +9,6 @@ from ..exceptions import CustomValueError, NotFoundEnumValue
|
|
|
9
9
|
from ..types import FuncExceptT
|
|
10
10
|
|
|
11
11
|
__all__ = [
|
|
12
|
-
'SelfEnum',
|
|
13
12
|
'CustomEnum', 'CustomIntEnum', 'CustomStrEnum'
|
|
14
13
|
]
|
|
15
14
|
|
|
@@ -75,6 +74,3 @@ class CustomStrEnum(str, CustomEnum):
|
|
|
75
74
|
"""Base class for custom str enums."""
|
|
76
75
|
|
|
77
76
|
value: str
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
SelfEnum = TypeVar('SelfEnum', bound=CustomEnum)
|
jetpytools/exceptions/base.py
CHANGED
|
@@ -72,10 +72,6 @@ class CustomErrorMeta(type):
|
|
|
72
72
|
|
|
73
73
|
return exception
|
|
74
74
|
|
|
75
|
-
if TYPE_CHECKING:
|
|
76
|
-
def __getitem__(self, exception: type[Exception]) -> CustomError:
|
|
77
|
-
...
|
|
78
|
-
|
|
79
75
|
|
|
80
76
|
SelfCErrorMeta = TypeVar('SelfCErrorMeta', bound=CustomErrorMeta)
|
|
81
77
|
|
|
@@ -102,17 +98,11 @@ class CustomError(ExceptionT, metaclass=CustomErrorMeta):
|
|
|
102
98
|
super().__init__(message)
|
|
103
99
|
|
|
104
100
|
def __class_getitem__(cls, exception: str | type[ExceptionT] | ExceptionT) -> CustomError:
|
|
105
|
-
|
|
106
|
-
class inner_exception(cls): # type: ignore
|
|
107
|
-
...
|
|
108
|
-
else:
|
|
109
|
-
if not issubclass(exception, type): # type: ignore
|
|
110
|
-
exception = exception.__class__ # type: ignore
|
|
101
|
+
from warnings import warn
|
|
111
102
|
|
|
112
|
-
|
|
113
|
-
...
|
|
103
|
+
warn("Custom error is not subscriptable anymore. Don't use it", DeprecationWarning)
|
|
114
104
|
|
|
115
|
-
return
|
|
105
|
+
return cls()
|
|
116
106
|
|
|
117
107
|
def __call__(
|
|
118
108
|
self,
|
jetpytools/types/builtins.py
CHANGED
|
@@ -3,12 +3,12 @@ from __future__ import annotations
|
|
|
3
3
|
from typing import Any, Callable, ParamSpec, Sequence, SupportsFloat, SupportsIndex, TypeAlias, TypeVar, Union
|
|
4
4
|
|
|
5
5
|
__all__ = [
|
|
6
|
-
'T', 'T0', 'T1', 'T2', 'T_contra',
|
|
6
|
+
'T', 'T0', 'T1', 'T2', 'T_co', 'T0_co', 'T1_co', 'T_contra',
|
|
7
7
|
|
|
8
8
|
'F', 'F0', 'F1', 'F2',
|
|
9
9
|
|
|
10
10
|
'P', 'P0', 'P1', 'P2',
|
|
11
|
-
'R', 'R0', 'R1', 'R2', 'R_co', 'R0_co', 'R_contra',
|
|
11
|
+
'R', 'R0', 'R1', 'R2', 'R_co', 'R0_co', 'R1_co', 'R_contra',
|
|
12
12
|
|
|
13
13
|
'Nb',
|
|
14
14
|
|
|
@@ -20,13 +20,9 @@ __all__ = [
|
|
|
20
20
|
'SimpleByteData', 'SimpleByteDataArray',
|
|
21
21
|
'ByteData',
|
|
22
22
|
|
|
23
|
-
'KwargsT'
|
|
24
|
-
|
|
25
|
-
'Self'
|
|
23
|
+
'KwargsT'
|
|
26
24
|
]
|
|
27
25
|
|
|
28
|
-
Self = TypeVar('Self')
|
|
29
|
-
|
|
30
26
|
Nb = TypeVar('Nb', float, int)
|
|
31
27
|
|
|
32
28
|
T = TypeVar('T')
|
|
@@ -49,8 +45,13 @@ R0 = TypeVar('R0')
|
|
|
49
45
|
R1 = TypeVar('R1')
|
|
50
46
|
R2 = TypeVar('R2')
|
|
51
47
|
|
|
48
|
+
T_co = TypeVar('T_co', covariant=True)
|
|
49
|
+
T0_co = TypeVar('T0_co', covariant=True)
|
|
50
|
+
T1_co = TypeVar('T1_co', covariant=True)
|
|
51
|
+
|
|
52
52
|
R_co = TypeVar('R_co', covariant=True)
|
|
53
53
|
R0_co = TypeVar('R0_co', covariant=True)
|
|
54
|
+
R1_co = TypeVar('R1_co', covariant=True)
|
|
54
55
|
|
|
55
56
|
T_contra = TypeVar('T_contra', contravariant=True)
|
|
56
57
|
R_contra = TypeVar('R_contra', contravariant=True)
|
jetpytools/types/utils.py
CHANGED
|
@@ -3,14 +3,14 @@ from __future__ import annotations
|
|
|
3
3
|
from functools import partial, wraps
|
|
4
4
|
from inspect import Signature
|
|
5
5
|
from inspect import _empty as empty_param
|
|
6
|
-
from inspect import isclass
|
|
7
6
|
from typing import (
|
|
8
|
-
TYPE_CHECKING, Any, Callable, Concatenate, Generator, Generic, Iterable, Iterator, Mapping,
|
|
9
|
-
|
|
7
|
+
TYPE_CHECKING, Any, Callable, Concatenate, Generator, Generic, Iterable, Iterator, Mapping, NoReturn, Protocol,
|
|
8
|
+
Sequence, TypeVar, cast, overload
|
|
10
9
|
)
|
|
10
|
+
|
|
11
11
|
from typing_extensions import Self
|
|
12
12
|
|
|
13
|
-
from .builtins import F0, F1, P0, P1, R0, R1, T0, T1, T2, KwargsT, P, R, R_co,
|
|
13
|
+
from .builtins import F0, F1, P0, P1, R0, R1, T0, T1, T2, KwargsT, P, R, R0_co, R1_co, R_co, T, T0_co, T1_co, T_co
|
|
14
14
|
|
|
15
15
|
__all__ = [
|
|
16
16
|
'copy_signature',
|
|
@@ -67,47 +67,33 @@ class copy_signature(Generic[F0]):
|
|
|
67
67
|
return cast(F0, wrapped)
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
class injected_self_func(
|
|
70
|
+
class injected_self_func(Protocol[T_co, P, R_co]):
|
|
71
71
|
@overload
|
|
72
72
|
@staticmethod
|
|
73
|
-
def __call__(*args: P.args, **kwargs: P.kwargs) ->
|
|
73
|
+
def __call__(*args: P.args, **kwargs: P.kwargs) -> R_co:
|
|
74
74
|
...
|
|
75
75
|
|
|
76
76
|
@overload
|
|
77
77
|
@staticmethod
|
|
78
|
-
def __call__(self:
|
|
78
|
+
def __call__(self: T_co, *args: P.args, **kwargs: P.kwargs) -> R_co: # type: ignore[misc]
|
|
79
79
|
...
|
|
80
80
|
|
|
81
81
|
@overload
|
|
82
82
|
@staticmethod
|
|
83
|
-
def __call__(
|
|
83
|
+
def __call__(cls: type[T_co], *args: P.args, **kwargs: P.kwargs) -> R_co:
|
|
84
84
|
...
|
|
85
85
|
|
|
86
|
-
@overload
|
|
87
|
-
@staticmethod
|
|
88
|
-
def __call__(cls: type[T], *args: P.args, **kwargs: P.kwargs) -> R:
|
|
89
|
-
...
|
|
90
86
|
|
|
91
|
-
|
|
92
|
-
@staticmethod
|
|
93
|
-
def __call__(cls: type[T], _cls: type[T], *args: P.args, **kwargs: P.kwargs) -> R:
|
|
94
|
-
...
|
|
87
|
+
self_objects_cache = dict[Any, Any]()
|
|
95
88
|
|
|
96
|
-
@staticmethod
|
|
97
|
-
def __call__(*args: Any, **kwds: Any) -> Any:
|
|
98
|
-
...
|
|
99
89
|
|
|
100
|
-
|
|
101
|
-
self_objects_cache = dict[type, Any]()
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
class inject_self_base(Generic[T, P, R]):
|
|
90
|
+
class inject_self_base(Generic[T_co, P, R_co]):
|
|
105
91
|
cache: bool | None
|
|
106
92
|
signature: Signature | None
|
|
107
93
|
init_kwargs: list[str] | None
|
|
108
94
|
first_key: str | None
|
|
109
95
|
|
|
110
|
-
def __init__(self, function: Callable[Concatenate[
|
|
96
|
+
def __init__(self, function: Callable[Concatenate[T_co, P], R_co], /, *, cache: bool = False) -> None:
|
|
111
97
|
"""
|
|
112
98
|
Wrap ``function`` to always have a self provided to it.
|
|
113
99
|
|
|
@@ -130,8 +116,8 @@ class inject_self_base(Generic[T, P, R]):
|
|
|
130
116
|
self.clean_kwargs = False
|
|
131
117
|
|
|
132
118
|
def __get__(
|
|
133
|
-
self, class_obj: type[T] | T | None, class_type: type[T] | type[type[T]] # type: ignore
|
|
134
|
-
) -> injected_self_func[
|
|
119
|
+
self, class_obj: type[T] | T | None, class_type: type[T] | type[type[T]] | Any # type: ignore[valid-type]
|
|
120
|
+
) -> injected_self_func[T_co, P, R_co]:
|
|
135
121
|
if not self.signature or not self.first_key:
|
|
136
122
|
self.signature = Signature.from_callable(self.function, eval_str=True)
|
|
137
123
|
self.first_key = next(iter(list(self.signature.parameters.keys())), None)
|
|
@@ -187,8 +173,8 @@ class inject_self_base(Generic[T, P, R]):
|
|
|
187
173
|
|
|
188
174
|
return _wrapper
|
|
189
175
|
|
|
190
|
-
def __call__(self, *args: P.args, **kwargs: P.kwargs) ->
|
|
191
|
-
return self.__get__(None, self)(*args, **kwargs)
|
|
176
|
+
def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R_co:
|
|
177
|
+
return self.__get__(None, self)(*args, **kwargs)
|
|
192
178
|
|
|
193
179
|
@property
|
|
194
180
|
def __signature__(self) -> Signature:
|
|
@@ -197,7 +183,7 @@ class inject_self_base(Generic[T, P, R]):
|
|
|
197
183
|
@classmethod
|
|
198
184
|
def with_args(
|
|
199
185
|
cls, *args: Any, **kwargs: Any
|
|
200
|
-
) -> Callable[[Callable[Concatenate[
|
|
186
|
+
) -> Callable[[Callable[Concatenate[T0_co, P0], R0_co]], inject_self[T0_co, P0, R0_co]]:
|
|
201
187
|
"""Provide custom args to instantiate the ``self`` object with."""
|
|
202
188
|
|
|
203
189
|
def _wrapper(function: Callable[Concatenate[T0, P0], R0]) -> inject_self[T0, P0, R0]:
|
|
@@ -208,69 +194,71 @@ class inject_self_base(Generic[T, P, R]):
|
|
|
208
194
|
return _wrapper
|
|
209
195
|
|
|
210
196
|
|
|
211
|
-
class inject_self(
|
|
197
|
+
class inject_self(inject_self_base[T_co, P, R_co]):
|
|
212
198
|
"""Wrap a method so it always has a constructed ``self`` provided to it."""
|
|
213
199
|
|
|
214
|
-
class cached(
|
|
200
|
+
class cached(inject_self_base[T0_co, P0, R0_co]):
|
|
215
201
|
"""
|
|
216
202
|
Wrap a method so it always has a constructed ``self`` provided to it.
|
|
217
203
|
Once ``self`` is constructed, it will be reused.
|
|
218
204
|
"""
|
|
219
205
|
|
|
220
|
-
class property(Generic[
|
|
221
|
-
def __init__(self, function: Callable[[
|
|
206
|
+
class property(Generic[T1_co, R1_co]):
|
|
207
|
+
def __init__(self, function: Callable[[T1_co], R1_co]) -> None:
|
|
222
208
|
self.function = inject_self(function)
|
|
223
209
|
|
|
224
210
|
def __get__(
|
|
225
|
-
self, class_obj: type[
|
|
226
|
-
) ->
|
|
211
|
+
self, class_obj: type[T1_co] | T1_co | None, class_type: type[T1_co] | T1_co
|
|
212
|
+
) -> R1_co:
|
|
227
213
|
return self.function.__get__(class_obj, class_type)()
|
|
228
214
|
|
|
229
|
-
class init_kwargs(
|
|
215
|
+
class init_kwargs(inject_self_base[T0_co, P0, R0_co]):
|
|
230
216
|
"""
|
|
231
217
|
Wrap a method so it always has a constructed ``self`` provided to it.
|
|
232
218
|
When constructed, kwargs to the function will be passed to the constructor.
|
|
233
219
|
"""
|
|
234
220
|
|
|
235
221
|
@classmethod
|
|
236
|
-
def clean(cls, function: Callable[Concatenate[
|
|
222
|
+
def clean(cls, function: Callable[Concatenate[T1_co, P1], R1_co]) -> inject_self[T1_co, P1, R1_co]:
|
|
237
223
|
"""Wrap a method, pass kwargs to the constructor and remove them from actual **kwargs."""
|
|
238
224
|
inj = cls(function) # type: ignore
|
|
239
225
|
inj.clean_kwargs = True
|
|
240
226
|
return inj # type: ignore
|
|
241
227
|
|
|
242
|
-
class property(Generic[
|
|
243
|
-
def __init__(self, function: Callable[[
|
|
228
|
+
class property(Generic[T0_co, R0_co]):
|
|
229
|
+
def __init__(self, function: Callable[[T0_co], R0_co]) -> None:
|
|
244
230
|
self.function = inject_self(function)
|
|
245
231
|
|
|
246
232
|
def __get__(
|
|
247
|
-
self, class_obj: type[
|
|
248
|
-
) ->
|
|
233
|
+
self, class_obj: type[T0_co] | T0_co | None, class_type: type[T0_co] | T0_co
|
|
234
|
+
) -> R0_co:
|
|
249
235
|
return self.function.__get__(class_obj, class_type)()
|
|
250
236
|
|
|
251
237
|
|
|
252
|
-
class inject_kwargs_params_base_func(Generic[
|
|
253
|
-
def __call__(self:
|
|
254
|
-
|
|
238
|
+
class inject_kwargs_params_base_func(Generic[T_co, P, R_co]):
|
|
239
|
+
def __call__(self: T_co, *args: P.args, **kwargs: P.kwargs) -> R_co:
|
|
240
|
+
raise NotImplementedError
|
|
255
241
|
|
|
256
242
|
|
|
257
|
-
class inject_kwargs_params_base(Generic[
|
|
243
|
+
class inject_kwargs_params_base(Generic[T_co, P, R_co]):
|
|
244
|
+
signature: Signature | None
|
|
245
|
+
|
|
258
246
|
_kwargs_name = 'kwargs'
|
|
259
247
|
|
|
260
|
-
def __init__(self, function: Callable[Concatenate[
|
|
248
|
+
def __init__(self, function: Callable[Concatenate[T_co, P], R_co]) -> None:
|
|
261
249
|
self.function = function
|
|
262
250
|
|
|
263
251
|
self.signature = None
|
|
264
252
|
|
|
265
253
|
def __get__(
|
|
266
254
|
self, class_obj: T, class_type: type[T]
|
|
267
|
-
) -> inject_kwargs_params_base_func[
|
|
255
|
+
) -> inject_kwargs_params_base_func[T_co, P, R_co]:
|
|
268
256
|
if not self.signature:
|
|
269
|
-
self.signature = Signature.from_callable(self.function, eval_str=True)
|
|
257
|
+
self.signature = Signature.from_callable(self.function, eval_str=True)
|
|
270
258
|
|
|
271
259
|
if (
|
|
272
|
-
isinstance(self, inject_kwargs_params.add_to_kwargs) # type: ignore
|
|
273
|
-
and (4 not in {x.kind for x in self.signature.parameters.values()})
|
|
260
|
+
isinstance(self, inject_kwargs_params.add_to_kwargs) # type: ignore[arg-type]
|
|
261
|
+
and (4 not in {x.kind for x in self.signature.parameters.values()})
|
|
274
262
|
):
|
|
275
263
|
from ..exceptions import CustomValueError
|
|
276
264
|
|
|
@@ -281,10 +269,10 @@ class inject_kwargs_params_base(Generic[T, P, R]):
|
|
|
281
269
|
this = self
|
|
282
270
|
|
|
283
271
|
@wraps(self.function)
|
|
284
|
-
def _wrapper(self:
|
|
272
|
+
def _wrapper(self: Any, *_args: Any, **kwargs: Any) -> R_co:
|
|
285
273
|
assert this.signature
|
|
286
274
|
|
|
287
|
-
if class_obj and not isinstance(self, class_type):
|
|
275
|
+
if class_obj and not isinstance(self, class_type):
|
|
288
276
|
_args = (self, *_args)
|
|
289
277
|
self = class_obj
|
|
290
278
|
|
|
@@ -318,14 +306,14 @@ class inject_kwargs_params_base(Generic[T, P, R]):
|
|
|
318
306
|
|
|
319
307
|
kwargs[key] = kw_value
|
|
320
308
|
|
|
321
|
-
if isinstance(this, inject_kwargs_params.add_to_kwargs):
|
|
309
|
+
if isinstance(this, inject_kwargs_params.add_to_kwargs): # type: ignore[arg-type]
|
|
322
310
|
kwargs |= this_kwargs
|
|
323
311
|
|
|
324
312
|
return this.function(self, *args, **kwargs)
|
|
325
313
|
|
|
326
314
|
return _wrapper # type: ignore
|
|
327
315
|
|
|
328
|
-
def __call__(self, *args: P.args, **kwargs: P.kwargs) ->
|
|
316
|
+
def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R_co:
|
|
329
317
|
return self.__get__(None, self)(*args, **kwargs) # type: ignore
|
|
330
318
|
|
|
331
319
|
@property
|
|
@@ -422,89 +410,55 @@ def get_subclasses(family: type[T], exclude: Sequence[type[T]] = []) -> list[typ
|
|
|
422
410
|
return list(set(_subclasses(family)))
|
|
423
411
|
|
|
424
412
|
|
|
425
|
-
class classproperty(Generic[
|
|
413
|
+
class classproperty(Generic[T, R]):
|
|
426
414
|
"""
|
|
427
415
|
Make a class property. A combination between classmethod and property.
|
|
428
416
|
"""
|
|
429
417
|
|
|
430
418
|
__isabstractmethod__: bool = False
|
|
431
419
|
|
|
432
|
-
class metaclass(type):
|
|
433
|
-
"""This must be set for the decorator to work."""
|
|
434
|
-
|
|
435
|
-
def __setattr__(self, key: str, value: Any) -> None:
|
|
436
|
-
if key in self.__dict__:
|
|
437
|
-
obj = self.__dict__.get(key)
|
|
438
|
-
|
|
439
|
-
if obj and isinstance(obj, classproperty):
|
|
440
|
-
obj.__set__(self, value)
|
|
441
|
-
return
|
|
442
|
-
|
|
443
|
-
super(classproperty.metaclass, self).__setattr__(key, value)
|
|
444
|
-
|
|
445
420
|
def __init__(
|
|
446
421
|
self,
|
|
447
|
-
fget:
|
|
448
|
-
fset:
|
|
449
|
-
fdel:
|
|
422
|
+
fget: Callable[[type[T]], R] | classmethod[T, ..., R],
|
|
423
|
+
fset: Callable[[type[T], R], None] | classmethod[T, Concatenate[R, ...], None] | None = None,
|
|
424
|
+
fdel: Callable[[type[T]], None] | classmethod[T, ..., None] | None = None,
|
|
450
425
|
doc: str | None = None,
|
|
451
426
|
) -> None:
|
|
452
427
|
self.fget = self._wrap(fget)
|
|
453
428
|
self.fset = self._wrap(fset) if fset is not None else fset
|
|
454
429
|
self.fdel = self._wrap(fdel) if fdel is not None else fdel
|
|
455
430
|
|
|
456
|
-
self.
|
|
431
|
+
self.__doc__ = doc
|
|
457
432
|
|
|
458
|
-
def _wrap(self, func:
|
|
459
|
-
if not isinstance(func,
|
|
460
|
-
func = classmethod(func)
|
|
433
|
+
def _wrap(self, func: Callable[..., R1] | classmethod[T, P1, R1]) -> classmethod[T, P1, R1]:
|
|
434
|
+
if not isinstance(func, classmethod):
|
|
435
|
+
func = classmethod(func)
|
|
461
436
|
|
|
462
|
-
return func
|
|
437
|
+
return func
|
|
463
438
|
|
|
464
|
-
def
|
|
465
|
-
self.fget = self._wrap(__fget) # type: ignore
|
|
466
|
-
return self # type: ignore
|
|
467
|
-
|
|
468
|
-
def setter(self, __fset: classmethod[T1, P, None] | Callable[[T1, T2], None]) -> classproperty[P, R, T1, T2, P0]:
|
|
469
|
-
self.fset = self._wrap(__fset) # type: ignore
|
|
470
|
-
return self # type: ignore
|
|
471
|
-
|
|
472
|
-
def deleter(self, __fdel: classmethod[T1, P1, None] | Callable[P1, None]) -> classproperty[P, R, T, T0, P1]:
|
|
473
|
-
self.fdel = self._wrap(__fdel) # type: ignore
|
|
474
|
-
return self # type: ignore
|
|
475
|
-
|
|
476
|
-
def __get__(self, __obj: Any, __type: type | None = None) -> R:
|
|
439
|
+
def __get__(self, __obj: T | None, __type: type | None = None) -> R:
|
|
477
440
|
if __type is None:
|
|
478
441
|
__type = type(__obj)
|
|
479
442
|
|
|
480
|
-
return self.fget.__get__(__obj, __type)()
|
|
481
|
-
|
|
482
|
-
def __set__(self, __obj: Any, __value: Any) -> None:
|
|
483
|
-
from ..exceptions import CustomError
|
|
443
|
+
return self.fget.__get__(__obj, __type)()
|
|
484
444
|
|
|
445
|
+
def __set__(self, __obj: T, __value: Any) -> None:
|
|
485
446
|
if not self.fset:
|
|
486
|
-
raise
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
type_, __obj = __obj, None
|
|
490
|
-
else:
|
|
491
|
-
type_ = type(__obj)
|
|
492
|
-
|
|
493
|
-
return self.fset.__get__(__obj, type_)(__value)
|
|
447
|
+
raise AttributeError(
|
|
448
|
+
f'classproperty with getter "{self.__name__}" of "{__obj.__class__.__name__}" object has no setter.'
|
|
449
|
+
)
|
|
494
450
|
|
|
495
|
-
|
|
496
|
-
from ..exceptions import CustomError
|
|
451
|
+
self.fset.__get__(None, type(__obj))(__value)
|
|
497
452
|
|
|
453
|
+
def __delete__(self, __obj: T) -> None:
|
|
498
454
|
if not self.fdel:
|
|
499
|
-
raise
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
type_, __obj = __obj, None
|
|
503
|
-
else:
|
|
504
|
-
type_ = type(__obj)
|
|
455
|
+
raise AttributeError(
|
|
456
|
+
f'classproperty with getter "{self.__name__}" of "{__obj.__class__.__name__}" object has no deleter.'
|
|
457
|
+
)
|
|
505
458
|
|
|
506
|
-
|
|
459
|
+
self.fdel.__get__(None, type(__obj))()
|
|
507
460
|
|
|
461
|
+
@property
|
|
508
462
|
def __name__(self) -> str:
|
|
509
463
|
return self.fget.__name__
|
|
510
464
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jetpytools
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: Collection of stuff that's useful in general python programming
|
|
5
5
|
Author: Jaded Encoding Thaumaturgy
|
|
6
6
|
Author-email: jaded.encoding.thaumaturgy@gmail.com
|
|
@@ -18,6 +18,7 @@ Classifier: Typing :: Typed
|
|
|
18
18
|
Requires-Python: >=3.10
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
|
+
Requires-Dist: typing_extensions>=4.12.2
|
|
21
22
|
Dynamic: author
|
|
22
23
|
Dynamic: author-email
|
|
23
24
|
Dynamic: classifier
|
|
@@ -27,6 +28,7 @@ Dynamic: license-file
|
|
|
27
28
|
Dynamic: maintainer
|
|
28
29
|
Dynamic: maintainer-email
|
|
29
30
|
Dynamic: project-url
|
|
31
|
+
Dynamic: requires-dist
|
|
30
32
|
Dynamic: requires-python
|
|
31
33
|
Dynamic: summary
|
|
32
34
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
jetpytools/__init__.py,sha256=FSVZdj69oy4mBXd6OXiRHrUhaSc4Exo1pQHBlXycV98,214
|
|
2
|
-
jetpytools/_metadata.py,sha256=
|
|
2
|
+
jetpytools/_metadata.py,sha256=v1lmWTzb06HMM9cWuvZNc6UWkUsfNUm_rmuwcgdFavs,414
|
|
3
3
|
jetpytools/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
jetpytools/enums/__init__.py,sha256=5n6Cu8Yb9N6hIa_YTsyy_s0cCgCnh0vDb-NyXK2RwV0,81
|
|
5
|
-
jetpytools/enums/base.py,sha256=
|
|
5
|
+
jetpytools/enums/base.py,sha256=m3jJ6rJwDm4vp2-qMsuRH-Ll2mQDXA-wkmhw4xaafTM,2003
|
|
6
6
|
jetpytools/enums/other.py,sha256=DerFtmdjNK41ZxSYt601vHV5yzvZHPfTKNDlj-FjHm8,1346
|
|
7
7
|
jetpytools/exceptions/__init__.py,sha256=g8GT0XqcNuHFHgQGSRj6a_X1kBiBQGP05soYNbEIN_Q,205
|
|
8
|
-
jetpytools/exceptions/base.py,sha256=
|
|
8
|
+
jetpytools/exceptions/base.py,sha256=OZS5sJlNCh4Qy-2flvZugYpyJuXoRrxXa7RFqdDAktw,5969
|
|
9
9
|
jetpytools/exceptions/enum.py,sha256=9YoWwEfyd9k7NwanAqtXbhJaJQAnjRKqsAO73cDvcpA,223
|
|
10
10
|
jetpytools/exceptions/file.py,sha256=QwhUFAoG3NsFFYuPe5O_I6K969CzlrTCv3RTrfzx8B0,1107
|
|
11
11
|
jetpytools/exceptions/generic.py,sha256=kMj5lR3ifHk3uNhpxN6Lu4Am0vi7E6TfQezkZulqhaQ,1482
|
|
@@ -15,20 +15,20 @@ jetpytools/functions/funcs.py,sha256=EMoJ_h2tl8Cgr1PXAsmRvgaOY5YL7AiEnGGo3-H76tk
|
|
|
15
15
|
jetpytools/functions/normalize.py,sha256=2BACok7TAN5ldANyYrbGhUpOkj84siApAYy6ndlhUfI,6316
|
|
16
16
|
jetpytools/functions/other.py,sha256=TRz91spvdYJUh9vKe3Kuw6xZfSEJvrQs1mZVg7SyYmY,413
|
|
17
17
|
jetpytools/types/__init__.py,sha256=yDT-PYTTzH6DyHsQcKvOy1jrCPmUQRKrjCM3apd0kNw,294
|
|
18
|
-
jetpytools/types/builtins.py,sha256=
|
|
18
|
+
jetpytools/types/builtins.py,sha256=hndNUoxBeFx9kgSj-6Lm8rjQH0a9lkrqRqPDObr0pbk,1969
|
|
19
19
|
jetpytools/types/check.py,sha256=Ivf_JkVLG9OgiKXYjq-8azoROLjJvhNNqPq_KDIiOkI,971
|
|
20
20
|
jetpytools/types/file.py,sha256=j46SCbdhus2wtxddAGSCn6V4nJdWWwpnAfW1K3P3ewg,6205
|
|
21
21
|
jetpytools/types/funcs.py,sha256=9qONnDWdpqvRj7vL3W9BLwWeGyQipXQgxOaPjqpQ1M4,3119
|
|
22
22
|
jetpytools/types/generic.py,sha256=sAyBwGVG5FZ-6HVpfRuczov_6zQ_Uyoi0QWnR2iMm9Q,1128
|
|
23
23
|
jetpytools/types/supports.py,sha256=--VZ-iCUiv-a6K8n-H8-6hSxHjrvdYg9mCLhr_lRplo,3051
|
|
24
|
-
jetpytools/types/utils.py,sha256=
|
|
24
|
+
jetpytools/types/utils.py,sha256=eT3yoFUEQy4vKTyLDMp_6Ixy7woyF4afWgiLhS-Vr38,21030
|
|
25
25
|
jetpytools/utils/__init__.py,sha256=v5Bkl43-OBWlXx9OWpZoGH-QMaYNsPIi4vfuhC13ZLI,163
|
|
26
26
|
jetpytools/utils/file.py,sha256=9GhMGJ5D7CpvUFnvnwPFMloYTeIX-AJ7aKYKdoJQ374,10455
|
|
27
27
|
jetpytools/utils/funcs.py,sha256=ZuLz63kveBY1CLlBexEqmrQiGC67dY4gaXdNU3CeBMw,898
|
|
28
28
|
jetpytools/utils/math.py,sha256=lNTriLtTXgqN82DVSXJ5KUbhsWgxXoJ5eNGIZ0-_r_c,3335
|
|
29
29
|
jetpytools/utils/ranges.py,sha256=dL3WG235Pz9sk5su8A0VdwVf_oSt6obR7R_JNwLyCjQ,2572
|
|
30
|
-
jetpytools-1.
|
|
31
|
-
jetpytools-1.
|
|
32
|
-
jetpytools-1.
|
|
33
|
-
jetpytools-1.
|
|
34
|
-
jetpytools-1.
|
|
30
|
+
jetpytools-1.4.0.dist-info/licenses/LICENSE,sha256=l0PN-qDtXcgOB5aXP_nSUsvCK5V3o9pQCGsTzyZhKL0,1071
|
|
31
|
+
jetpytools-1.4.0.dist-info/METADATA,sha256=vNcju4cgq0KyWoml7dd6q6QWq8KCvUIQT-DciIXtYe8,1485
|
|
32
|
+
jetpytools-1.4.0.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
|
33
|
+
jetpytools-1.4.0.dist-info/top_level.txt,sha256=Iy4HjIta33ADJxN9Nyt5t5jRIfotEkZkQcOSw4eG8Cs,11
|
|
34
|
+
jetpytools-1.4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|