jetpytools 1.7.3__py3-none-any.whl → 2.0.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.

@@ -1,20 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from abc import abstractmethod
4
- from typing import (
5
- Any,
6
- Callable,
7
- Iterable,
8
- Protocol,
9
- SupportsFloat,
10
- SupportsIndex,
11
- TypeAlias,
12
- TypeVar,
13
- overload,
14
- runtime_checkable,
15
- )
16
-
17
- from .builtins import T0, T1, T2, T_co, T_contra
4
+ from typing import Any, Callable, Iterable, Protocol, SupportsFloat, SupportsIndex, TypeVar, overload, runtime_checkable
18
5
 
19
6
  __all__ = [
20
7
  "ComparatorFunc",
@@ -36,17 +23,13 @@ __all__ = [
36
23
  ]
37
24
 
38
25
 
39
- _KT = TypeVar("_KT")
40
- _VT_co = TypeVar("_VT_co", covariant=True)
41
-
42
-
43
26
  @runtime_checkable
44
- class SupportsAdd(Protocol[T_contra, T_co]):
27
+ class SupportsAdd[T_contra, T_co](Protocol):
45
28
  def __add__(self, x: T_contra, /) -> T_co: ...
46
29
 
47
30
 
48
31
  @runtime_checkable
49
- class SupportsRAdd(Protocol[T_contra, T_co]):
32
+ class SupportsRAdd[T_contra, T_co](Protocol):
50
33
  def __radd__(self, x: T_contra, /) -> T_co: ...
51
34
 
52
35
 
@@ -68,22 +51,22 @@ class SupportsString(Protocol):
68
51
 
69
52
 
70
53
  @runtime_checkable
71
- class SupportsDunderLT(Protocol[T_contra]):
54
+ class SupportsDunderLT[T_contra](Protocol):
72
55
  def __lt__(self, other: T_contra) -> bool: ...
73
56
 
74
57
 
75
58
  @runtime_checkable
76
- class SupportsDunderGT(Protocol[T_contra]):
59
+ class SupportsDunderGT[T_contra](Protocol):
77
60
  def __gt__(self, other: T_contra) -> bool: ...
78
61
 
79
62
 
80
63
  @runtime_checkable
81
- class SupportsDunderLE(Protocol[T_contra]):
64
+ class SupportsDunderLE[T_contra](Protocol):
82
65
  def __le__(self, other: T_contra) -> bool: ...
83
66
 
84
67
 
85
68
  @runtime_checkable
86
- class SupportsDunderGE(Protocol[T_contra]):
69
+ class SupportsDunderGE[T_contra](Protocol):
87
70
  def __ge__(self, other: T_contra) -> bool: ...
88
71
 
89
72
 
@@ -93,7 +76,7 @@ class SupportsAllComparisons(
93
76
  ): ...
94
77
 
95
78
 
96
- SupportsRichComparison: TypeAlias = SupportsDunderLT[Any] | SupportsDunderGT[Any]
79
+ type SupportsRichComparison = SupportsDunderLT[Any] | SupportsDunderGT[Any]
97
80
  SupportsRichComparisonT = TypeVar("SupportsRichComparisonT", bound=SupportsRichComparison)
98
81
 
99
82
 
@@ -109,7 +92,7 @@ class ComparatorFunc(Protocol):
109
92
  ) -> SupportsRichComparisonT: ...
110
93
 
111
94
  @overload
112
- def __call__(self, arg1: T0, arg2: T0, /, *_args: T0, key: Callable[[T0], SupportsRichComparison]) -> T0: ...
95
+ def __call__[T](self, arg1: T, arg2: T, /, *_args: T, key: Callable[[T], SupportsRichComparison]) -> T: ...
113
96
 
114
97
  @overload
115
98
  def __call__(
@@ -117,27 +100,27 @@ class ComparatorFunc(Protocol):
117
100
  ) -> SupportsRichComparisonT: ...
118
101
 
119
102
  @overload
120
- def __call__(self, iterable: Iterable[T0], /, *, key: Callable[[T0], SupportsRichComparison]) -> T0: ...
103
+ def __call__[T](self, iterable: Iterable[T], /, *, key: Callable[[T], SupportsRichComparison]) -> T: ...
121
104
 
122
105
  @overload
123
- def __call__(
124
- self, iterable: Iterable[SupportsRichComparisonT], /, *, key: None = ..., default: T0
125
- ) -> SupportsRichComparisonT | T0: ...
106
+ def __call__[T, SupportsRichComparisonT: SupportsRichComparison](
107
+ self, iterable: Iterable[SupportsRichComparisonT], /, *, key: None = ..., default: T
108
+ ) -> SupportsRichComparisonT | T: ...
126
109
 
127
110
  @overload
128
- def __call__(
129
- self, iterable: Iterable[T1], /, *, key: Callable[[T1], SupportsRichComparison], default: T2
130
- ) -> T1 | T2: ...
111
+ def __call__[T0, T1](
112
+ self, iterable: Iterable[T0], /, *, key: Callable[[T0], SupportsRichComparison], default: T1
113
+ ) -> T0 | T1: ...
131
114
 
132
115
 
133
- class SupportsIndexing(Protocol[_VT_co]):
134
- def __getitem__(self, k: int) -> _VT_co: ...
116
+ class SupportsIndexing[T](Protocol):
117
+ def __getitem__(self, k: int) -> T: ...
135
118
 
136
119
 
137
- class SupportsKeysAndGetItem(Protocol[_KT, _VT_co]):
138
- def keys(self) -> Iterable[_KT]: ...
120
+ class SupportsKeysAndGetItem[KT, VT](Protocol):
121
+ def keys(self) -> Iterable[KT]: ...
139
122
 
140
- def __getitem__(self, k: _KT) -> _VT_co: ...
123
+ def __getitem__(self, k: KT) -> VT: ...
141
124
 
142
125
 
143
- SupportsFloatOrIndex: TypeAlias = SupportsFloat | SupportsIndex
126
+ type SupportsFloatOrIndex = SupportsFloat | SupportsIndex