faster-eth-utils 5.3.13__cp310-cp310-macosx_11_0_arm64.whl → 5.3.14__cp310-cp310-macosx_11_0_arm64.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 faster-eth-utils might be problematic. Click here for more details.

Files changed (31) hide show
  1. faster_eth_utils/abi.cpython-310-darwin.so +0 -0
  2. faster_eth_utils/address.cpython-310-darwin.so +0 -0
  3. faster_eth_utils/applicators.cpython-310-darwin.so +0 -0
  4. faster_eth_utils/applicators.py +18 -9
  5. faster_eth_utils/conversions.cpython-310-darwin.so +0 -0
  6. faster_eth_utils/crypto.cpython-310-darwin.so +0 -0
  7. faster_eth_utils/currency.cpython-310-darwin.so +0 -0
  8. faster_eth_utils/curried/__init__.py +48 -47
  9. faster_eth_utils/debug.cpython-310-darwin.so +0 -0
  10. faster_eth_utils/decorators.cpython-310-darwin.so +0 -0
  11. faster_eth_utils/decorators.py +61 -21
  12. faster_eth_utils/encoding.cpython-310-darwin.so +0 -0
  13. faster_eth_utils/exceptions.cpython-310-darwin.so +0 -0
  14. faster_eth_utils/functional.cpython-310-darwin.so +0 -0
  15. faster_eth_utils/hexadecimal.cpython-310-darwin.so +0 -0
  16. faster_eth_utils/humanize.cpython-310-darwin.so +0 -0
  17. faster_eth_utils/logging.py +23 -22
  18. faster_eth_utils/module_loading.cpython-310-darwin.so +0 -0
  19. faster_eth_utils/network.cpython-310-darwin.so +0 -0
  20. faster_eth_utils/numeric.cpython-310-darwin.so +0 -0
  21. faster_eth_utils/toolz.cpython-310-darwin.so +0 -0
  22. faster_eth_utils/types.cpython-310-darwin.so +0 -0
  23. faster_eth_utils/types.py +2 -2
  24. faster_eth_utils/units.cpython-310-darwin.so +0 -0
  25. {faster_eth_utils-5.3.13.dist-info → faster_eth_utils-5.3.14.dist-info}/METADATA +8 -4
  26. faster_eth_utils-5.3.14.dist-info/RECORD +53 -0
  27. faster_eth_utils__mypyc.cpython-310-darwin.so +0 -0
  28. faster_eth_utils-5.3.13.dist-info/RECORD +0 -53
  29. {faster_eth_utils-5.3.13.dist-info → faster_eth_utils-5.3.14.dist-info}/WHEEL +0 -0
  30. {faster_eth_utils-5.3.13.dist-info → faster_eth_utils-5.3.14.dist-info}/licenses/LICENSE +0 -0
  31. {faster_eth_utils-5.3.13.dist-info → faster_eth_utils-5.3.14.dist-info}/top_level.txt +0 -0
Binary file
@@ -1,4 +1,5 @@
1
1
  from typing import (
2
+ TYPE_CHECKING,
2
3
  Any,
3
4
  Callable,
4
5
  Dict,
@@ -21,9 +22,6 @@ from typing_extensions import (
21
22
  from .decorators import (
22
23
  return_arg_type,
23
24
  )
24
- from .functional import (
25
- to_dict,
26
- )
27
25
  from .pydantic import (
28
26
  CamelModel,
29
27
  )
@@ -32,6 +30,9 @@ from .toolz import (
32
30
  curry,
33
31
  )
34
32
 
33
+ if TYPE_CHECKING:
34
+ from _typeshed import SupportsBool
35
+
35
36
  TArg = TypeVar("TArg")
36
37
  TReturn = TypeVar("TReturn")
37
38
  TOther = TypeVar("TOther")
@@ -41,7 +42,9 @@ Formatters = Callable[[List[Any]], List[Any]]
41
42
 
42
43
  @return_arg_type(2)
43
44
  def apply_formatter_at_index(
44
- formatter: Callable[[TArg], TReturn], at_index: int, value: Sequence[Union[TArg, TOther]]
45
+ formatter: Callable[[TArg], TReturn],
46
+ at_index: int,
47
+ value: Sequence[Union[TArg, TOther]],
45
48
  ) -> Generator[Union[TOther, TReturn], None, None]:
46
49
  try:
47
50
  item = value[at_index]
@@ -69,7 +72,7 @@ def combine_argument_formatters(*formatters: Callable[..., Any]) -> Formatters:
69
72
  )
70
73
 
71
74
  _formatter_at_index = curry(apply_formatter_at_index)
72
- return compose( # type: ignore
75
+ return compose( # type: ignore [no-any-return]
73
76
  *(
74
77
  _formatter_at_index(formatter, index)
75
78
  for index, formatter in enumerate(formatters)
@@ -100,14 +103,18 @@ def apply_formatters_to_sequence(
100
103
 
101
104
  @overload
102
105
  def apply_formatter_if(
103
- condition: Callable[[TArg], TypeGuard[TOther]], formatter: Callable[[TOther], TReturn], value: TArg
106
+ condition: Callable[[TArg], TypeGuard[TOther]],
107
+ formatter: Callable[[TOther], TReturn],
108
+ value: TArg,
104
109
  ) -> Union[TArg, TReturn]: ...
105
110
 
111
+
106
112
  @overload
107
113
  def apply_formatter_if(
108
114
  condition: Callable[[TArg], bool], formatter: Callable[[TArg], TReturn], value: TArg
109
115
  ) -> Union[TArg, TReturn]: ...
110
116
 
117
+
111
118
  def apply_formatter_if( # type: ignore [misc]
112
119
  condition: Union[Callable[[TArg], TypeGuard[TOther]], Callable[[TArg], bool]],
113
120
  formatter: Union[Callable[[TOther], TReturn], Callable[[TArg], TReturn]],
@@ -164,9 +171,11 @@ def apply_formatter_to_array(
164
171
 
165
172
 
166
173
  def apply_one_of_formatters(
167
- formatter_condition_pairs: Tuple[Tuple[Callable[[TArg], Any], Callable[[TArg], Any]], ...],
168
- value: Any,
169
- ) -> Any:
174
+ formatter_condition_pairs: Tuple[
175
+ Tuple[Callable[[TArg], "SupportsBool"], Callable[[TArg], TReturn]], ...
176
+ ],
177
+ value: TArg,
178
+ ) -> TReturn:
170
179
  for condition, formatter in formatter_condition_pairs:
171
180
  if condition(value):
172
181
  return formatter(value)
@@ -1,4 +1,5 @@
1
1
  from typing import (
2
+ TYPE_CHECKING,
2
3
  Any,
3
4
  Callable,
4
5
  Dict,
@@ -10,6 +11,7 @@ from typing import (
10
11
  Union,
11
12
  overload,
12
13
  )
14
+ from typing_extensions import TypeGuard
13
15
 
14
16
  from faster_eth_utils import (
15
17
  CamelModel,
@@ -118,41 +120,49 @@ from faster_eth_utils.toolz import (
118
120
  curry,
119
121
  )
120
122
 
123
+ if TYPE_CHECKING:
124
+ from _typeshed import SupportsBool
125
+
126
+
127
+ TArg = TypeVar("TArg")
128
+ TOther = TypeVar("TOther")
121
129
  TReturn = TypeVar("TReturn")
122
130
  TValue = TypeVar("TValue")
123
131
 
124
132
 
125
133
  @overload
126
134
  def apply_formatter_if(
127
- condition: Callable[..., bool],
128
- ) -> Callable[[Callable[..., TReturn]], Callable[[TValue], Union[TReturn, TValue]]]:
129
- pass
130
-
135
+ condition: Callable[[TArg], TypeGuard[TOther]],
136
+ ) -> Callable[[Callable[[TOther], TReturn]], Callable[[TArg], Union[TReturn, TArg]]]:
137
+ ...
131
138
 
132
139
  @overload
133
140
  def apply_formatter_if(
134
- condition: Callable[..., bool], formatter: Callable[..., TReturn]
135
- ) -> Callable[[TValue], Union[TReturn, TValue]]:
136
- pass
137
-
141
+ condition: Callable[[TArg], TypeGuard[TOther]], formatter: Callable[[TOther], TReturn]
142
+ ) -> Callable[[TArg], Union[TReturn, TArg]]:
143
+ ...
138
144
 
139
145
  @overload
140
146
  def apply_formatter_if(
141
- condition: Callable[..., bool], formatter: Callable[..., TReturn], value: TValue
142
- ) -> Union[TReturn, TValue]:
143
- pass
147
+ condition: Callable[[TArg], TypeGuard[TOther]], formatter: Callable[[TOther], TReturn], value: TArg
148
+ ) -> Union[TReturn, TArg]:
149
+ ...
144
150
 
151
+ @overload
152
+ def apply_formatter_if(
153
+ condition: Callable[[TArg], bool], formatter: Callable[[TArg], TReturn], value: TArg
154
+ ) -> Union[TReturn, TArg]:
155
+ ...
145
156
 
146
- # This is just a stub to appease mypy, it gets overwritten later
147
157
  def apply_formatter_if( # type: ignore
148
- condition: Callable[..., bool],
149
- formatter: Optional[Callable[..., TReturn]] = None,
150
- value: Optional[TValue] = None,
158
+ condition: Union[Callable[[TArg], TypeGuard[TOther]], Callable[[TArg], bool]],
159
+ formatter: Optional[Union[Callable[[TOther], TReturn], Callable[[TArg], TReturn]]] = None,
160
+ value: Optional[TArg] = None,
151
161
  ) -> Union[
152
- Callable[[Callable[..., TReturn]], Callable[[TValue], Union[TReturn, TValue]]],
153
- Callable[[TValue], Union[TReturn, TValue]],
162
+ Callable[[Callable[[TOther], TReturn]], Callable[[TArg], Union[TReturn, TArg]]],
163
+ Callable[[TArg], Union[TReturn, TArg]],
154
164
  TReturn,
155
- TValue,
165
+ TArg,
156
166
  ]:
157
167
  pass
158
168
 
@@ -160,96 +170,86 @@ def apply_formatter_if( # type: ignore
160
170
  @overload
161
171
  def apply_one_of_formatters(
162
172
  formatter_condition_pairs: Sequence[
163
- Tuple[Callable[..., bool], Callable[..., TReturn]]
173
+ Tuple[Callable[[TArg], "SupportsBool"], Callable[[TArg], TReturn]]
164
174
  ],
165
- ) -> Callable[[TValue], TReturn]:
166
- ...
175
+ ) -> Callable[[TArg], TReturn]: ...
167
176
 
168
177
 
169
178
  @overload
170
179
  def apply_one_of_formatters(
171
180
  formatter_condition_pairs: Sequence[
172
- Tuple[Callable[..., bool], Callable[..., TReturn]]
181
+ Tuple[Callable[[TArg], "SupportsBool"], Callable[[TArg], TReturn]]
173
182
  ],
174
- value: TValue,
175
- ) -> TReturn:
176
- ...
183
+ value: TArg,
184
+ ) -> TReturn: ...
177
185
 
178
186
 
179
187
  # This is just a stub to appease mypy, it gets overwritten later
180
- def apply_one_of_formatters( # type: ignore
188
+ def apply_one_of_formatters(
181
189
  formatter_condition_pairs: Sequence[
182
- Tuple[Callable[..., bool], Callable[..., TReturn]]
190
+ Tuple[Callable[[TArg], "SupportsBool"], Callable[[TArg], TReturn]]
183
191
  ],
184
- value: Optional[TValue] = None,
185
- ) -> TReturn:
186
- ...
192
+ value: Optional[TArg] = None,
193
+ ) -> TReturn: ...
187
194
 
188
195
 
189
196
  @overload
190
197
  def hexstr_if_str(
191
198
  to_type: Callable[..., TReturn],
192
- ) -> Callable[[Union[bytes, int, str]], TReturn]:
193
- ...
199
+ ) -> Callable[[Union[bytes, int, str]], TReturn]: ...
194
200
 
195
201
 
196
202
  @overload
197
203
  def hexstr_if_str(
198
204
  to_type: Callable[..., TReturn], to_format: Union[bytes, int, str]
199
- ) -> TReturn:
200
- ...
205
+ ) -> TReturn: ...
201
206
 
202
207
 
203
208
  # This is just a stub to appease mypy, it gets overwritten later
204
209
  def hexstr_if_str( # type: ignore
205
210
  to_type: Callable[..., TReturn], to_format: Optional[Union[bytes, int, str]] = None
206
- ) -> TReturn:
207
- ...
211
+ ) -> TReturn: ...
208
212
 
209
213
 
210
214
  @overload
211
215
  def text_if_str(
212
216
  to_type: Callable[..., TReturn],
213
- ) -> Callable[[Union[bytes, int, str]], TReturn]:
214
- ...
217
+ ) -> Callable[[Union[bytes, int, str]], TReturn]: ...
215
218
 
216
219
 
217
220
  @overload
218
221
  def text_if_str(
219
222
  to_type: Callable[..., TReturn], text_or_primitive: Union[bytes, int, str]
220
- ) -> TReturn:
221
- ...
223
+ ) -> TReturn: ...
222
224
 
223
225
 
224
226
  # This is just a stub to appease mypy, it gets overwritten later
225
227
  def text_if_str( # type: ignore
226
228
  to_type: Callable[..., TReturn],
227
229
  text_or_primitive: Optional[Union[bytes, int, str]] = None,
228
- ) -> TReturn:
229
- ...
230
+ ) -> TReturn: ...
230
231
 
231
232
 
232
233
  @overload
233
234
  def apply_formatters_to_dict(
234
235
  formatters: Dict[Any, Any], unaliased: bool = False
235
- ) -> Callable[[Dict[Any, Any]], TReturn]:
236
+ ) -> Callable[[Union[Dict[Any, Any], CamelModel]], Dict[Any, Any]]:
236
237
  ...
237
238
 
238
239
 
239
240
  @overload
240
241
  def apply_formatters_to_dict(
241
- formatters: Dict[Any, Any], value: Union[Dict[Any, Any], CamelModel]
242
+ formatters: Dict[Any, Any], value: Union[Dict[Any, Any], CamelModel], unaliased: bool = False
242
243
  ) -> Dict[Any, Any]:
243
244
  ...
244
245
 
245
246
 
246
247
  # This is just a stub to appease mypy, it gets overwritten later
247
- def apply_formatters_to_dict( # type: ignore
248
+ def apply_formatters_to_dict(
248
249
  formatters: Dict[Any, Any],
249
250
  value: Optional[Union[Dict[Any, Any], CamelModel]] = None,
250
251
  unaliased: bool = False,
251
- ) -> Dict[Any, Any]:
252
- ...
252
+ ) -> Dict[Any, Any]: ...
253
253
 
254
254
 
255
255
  apply_formatter_at_index = curry(apply_formatter_at_index)
@@ -289,6 +289,7 @@ del Sequence
289
289
  del TReturn
290
290
  del TValue
291
291
  del Tuple
292
+ del TypeGuard
292
293
  del TypeVar
293
294
  del Union
294
295
  del curry
@@ -1,69 +1,107 @@
1
1
  import functools
2
- import itertools
3
- import os
4
2
  from typing import (
5
3
  Any,
6
4
  Callable,
7
5
  Dict,
6
+ Final,
7
+ Generic,
8
8
  Optional,
9
+ Tuple,
9
10
  Type,
10
11
  TypeVar,
12
+ Union,
11
13
  final,
12
14
  )
13
15
 
14
- from .types import (
15
- is_text,
16
- )
16
+ from typing_extensions import Concatenate, ParamSpec
17
+
18
+ P = ParamSpec("P")
17
19
 
18
20
  T = TypeVar("T")
19
21
 
22
+ TInstance = TypeVar("TInstance", bound=object)
23
+ """A TypeVar representing an instance that a method can bind to."""
24
+
20
25
 
21
26
  @final
22
- class combomethod:
23
- def __init__(self, method: Callable[..., Any]) -> None:
24
- self.method = method
27
+ class combomethod(Generic[TInstance, P, T]):
28
+ def __init__(
29
+ self, method: Callable[Concatenate[Union[TInstance, Type[TInstance]], P], T]
30
+ ) -> None:
31
+ self.method: Final = method
32
+
33
+ def __repr__(self) -> str:
34
+ return f"combomethod({self.method})"
25
35
 
26
36
  def __get__(
27
- self, obj: Optional[T] = None, objtype: Optional[Type[T]] = None
28
- ) -> Callable[..., Any]:
37
+ self,
38
+ obj: Optional[TInstance],
39
+ objtype: Type[TInstance],
40
+ ) -> Callable[P, T]:
41
+
29
42
  @functools.wraps(self.method)
30
- def _wrapper(*args: Any, **kwargs: Any) -> Any:
43
+ def _wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
31
44
  if obj is not None:
32
45
  return self.method(obj, *args, **kwargs)
33
46
  else:
34
- return self.method(objtype, *args, **kwargs)
47
+ return self.method(objtype, *args, **kwargs) # type: ignore [arg-type]
35
48
 
36
49
  return _wrapper
37
50
 
38
51
 
39
- def return_arg_type(at_position: int) -> Callable[..., Callable[..., T]]:
52
+ _return_arg_type_deco_cache: Final[
53
+ Dict[int, Callable[[Callable[P, T]], Callable[P, Any]]]
54
+ ] = {}
55
+ # No need to hold so many unique instances in memory
56
+
57
+
58
+ def return_arg_type(at_position: int) -> Callable[[Callable[P, T]], Callable[P, Any]]:
40
59
  """
41
60
  Wrap the return value with the result of `type(args[at_position])`.
42
61
  """
62
+ if deco := _return_arg_type_deco_cache.get(at_position):
63
+ return deco
43
64
 
44
- def decorator(to_wrap: Callable[..., Any]) -> Callable[..., T]:
65
+ def decorator(to_wrap: Callable[P, Any]) -> Callable[P, Any]:
45
66
  @functools.wraps(to_wrap)
46
- def wrapper(*args: Any, **kwargs: Any) -> T: # type: ignore
67
+ def wrapper(*args: P.args, **kwargs: P.kwargs) -> Any:
47
68
  result = to_wrap(*args, **kwargs)
48
69
  ReturnType = type(args[at_position])
49
- return ReturnType(result) # type: ignore
70
+ return ReturnType(result) # type: ignore [call-arg]
50
71
 
51
72
  return wrapper
52
73
 
74
+ _return_arg_type_deco_cache[at_position] = decorator
75
+
53
76
  return decorator
54
77
 
55
78
 
79
+ ExcType = Type[BaseException]
80
+
81
+ ReplaceExceptionsCache = Dict[
82
+ Tuple[Tuple[ExcType, ExcType], ...],
83
+ Callable[[Callable[P, T]], Callable[P, T]],
84
+ ]
85
+
86
+ _replace_exceptions_deco_cache: Final[ReplaceExceptionsCache[..., Any]] = {}
87
+ # No need to hold so many unique instances in memory
88
+
89
+
56
90
  def replace_exceptions(
57
- old_to_new_exceptions: Dict[Type[BaseException], Type[BaseException]]
58
- ) -> Callable[[Callable[..., T]], Callable[..., T]]:
91
+ old_to_new_exceptions: Dict[ExcType, ExcType],
92
+ ) -> Callable[[Callable[P, T]], Callable[P, T]]:
59
93
  """
60
94
  Replaces old exceptions with new exceptions to be raised in their place.
61
95
  """
62
- old_exceptions = tuple(old_to_new_exceptions.keys())
96
+ cache_key = tuple(old_to_new_exceptions.items())
97
+ if deco := _replace_exceptions_deco_cache.get(cache_key):
98
+ return deco
99
+
100
+ old_exceptions = tuple(old_to_new_exceptions)
63
101
 
64
- def decorator(to_wrap: Callable[..., T]) -> Callable[..., T]:
102
+ def decorator(to_wrap: Callable[P, T]) -> Callable[P, T]:
65
103
  @functools.wraps(to_wrap)
66
- def wrapped(*args: Any, **kwargs: Any) -> T:
104
+ def wrapped(*args: P.args, **kwargs: P.kwargs) -> T:
67
105
  try:
68
106
  return to_wrap(*args, **kwargs)
69
107
  except old_exceptions as err:
@@ -76,4 +114,6 @@ def replace_exceptions(
76
114
 
77
115
  return wrapped
78
116
 
117
+ _replace_exceptions_deco_cache[cache_key] = decorator
118
+
79
119
  return decorator
@@ -12,6 +12,7 @@ from typing import (
12
12
  TypeVar,
13
13
  Union,
14
14
  cast,
15
+ overload,
15
16
  )
16
17
 
17
18
  from .toolz import (
@@ -53,8 +54,7 @@ def setup_DEBUG2_logging() -> None:
53
54
  """
54
55
  if not hasattr(logging, "DEBUG2"):
55
56
  logging.addLevelName(DEBUG2_LEVEL_NUM, "DEBUG2")
56
- logging.DEBUG2 = DEBUG2_LEVEL_NUM # type: ignore
57
-
57
+ logging.DEBUG2 = DEBUG2_LEVEL_NUM # type: ignore [attr-defined]
58
58
 
59
59
  @contextlib.contextmanager
60
60
  def _use_logger_class(logger_class: Type[logging.Logger]) -> Iterator[None]:
@@ -66,24 +66,26 @@ def _use_logger_class(logger_class: Type[logging.Logger]) -> Iterator[None]:
66
66
  logging.setLoggerClass(original_logger_class)
67
67
 
68
68
 
69
- def get_logger(name: str, logger_class: Union[Type[TLogger], None] = None) -> TLogger:
69
+ @overload
70
+ def get_logger(name: str, logger_class: Type[TLogger]) -> TLogger: ...
71
+ @overload
72
+ def get_logger(name: str, logger_class: None = None) -> logging.Logger: ...
73
+ def get_logger(name: str, logger_class: Union[Type[TLogger], None] = None) -> Union[TLogger, logging.Logger]:
70
74
  if logger_class is None:
75
+ return logging.getLogger(name)
76
+
77
+ with _use_logger_class(logger_class):
78
+ # The logging module caches logger instances. The following code
79
+ # ensures that if there is a cached instance that we don't
80
+ # accidentally return the incorrect logger type because the logging
81
+ # module does not *update* the cached instance in the event that
82
+ # the global logging class changes.
83
+ manager = logging.Logger.manager
84
+ logger_dict = manager.loggerDict
85
+ cached_logger = logger_dict.get(name)
86
+ if cached_logger is not None and type(cached_logger) is not logger_class:
87
+ del logger_dict[name]
71
88
  return cast(TLogger, logging.getLogger(name))
72
- else:
73
- with _use_logger_class(logger_class):
74
- # The logging module caches logger instances. The following code
75
- # ensures that if there is a cached instance that we don't
76
- # accidentally return the incorrect logger type because the logging
77
- # module does not *update* the cached instance in the event that
78
- # the global logging class changes.
79
- #
80
- # types ignored b/c mypy doesn't identify presence of
81
- # manager on logging.Logger
82
- manager = logging.Logger.manager
83
- if name in manager.loggerDict:
84
- if type(manager.loggerDict[name]) is not logger_class:
85
- del manager.loggerDict[name]
86
- return cast(TLogger, logging.getLogger(name))
87
89
 
88
90
 
89
91
  def get_extended_debug_logger(name: str) -> ExtendedDebugLogger:
@@ -115,9 +117,8 @@ class HasLoggerMeta(type):
115
117
  return super().__new__(mcls, name, bases, namespace)
116
118
  if "__qualname__" not in namespace:
117
119
  raise AttributeError("Missing __qualname__")
118
-
119
- with _use_logger_class(mcls.logger_class):
120
- logger = logging.getLogger(namespace["__qualname__"])
120
+
121
+ logger = get_logger(namespace["__qualname__"], mcls.logger_class)
121
122
 
122
123
  return super().__new__(mcls, name, bases, assoc(namespace, "logger", logger))
123
124
 
@@ -141,5 +142,5 @@ class HasLogger(metaclass=HasLoggerMeta):
141
142
  HasExtendedDebugLoggerMeta = HasLoggerMeta.replace_logger_class(ExtendedDebugLogger)
142
143
 
143
144
 
144
- class HasExtendedDebugLogger(metaclass=HasExtendedDebugLoggerMeta): # type: ignore
145
+ class HasExtendedDebugLogger(metaclass=HasExtendedDebugLoggerMeta): # type: ignore [metaclass,misc]
145
146
  logger: ExtendedDebugLogger
faster_eth_utils/types.py CHANGED
@@ -45,11 +45,11 @@ def is_boolean(value: Any) -> TypeGuard[bool]:
45
45
 
46
46
 
47
47
  def is_dict(obj: Any) -> TypeGuard[collections.abc.Mapping[Any, Any]]:
48
- return isinstance(obj, Mapping)
48
+ return isinstance(obj, dict) or isinstance(obj, Mapping)
49
49
 
50
50
 
51
51
  def is_list_like(obj: Any) -> TypeGuard[collections.abc.Sequence[Any]]:
52
- return not is_string(obj) and isinstance(obj, Sequence)
52
+ return isinstance(obj, (list, tuple)) or not is_string(obj) and isinstance(obj, Sequence)
53
53
 
54
54
 
55
55
  def is_list(obj: Any) -> TypeGuard[List[Any]]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: faster-eth-utils
3
- Version: 5.3.13
3
+ Version: 5.3.14
4
4
  Summary: A fork of eth-utils: Common utility functions for python code that interacts with Ethereum, implemented in C
5
5
  Home-page: https://github.com/BobTheBuidler/faster-eth-utils
6
6
  Author: The Ethereum Foundation
@@ -9,7 +9,10 @@ License: MIT
9
9
  Project-URL: Documentation, https://eth-utils.readthedocs.io/en/stable/
10
10
  Project-URL: Release Notes, https://github.com/BobTheBuidler/faster-eth-utils/releases
11
11
  Project-URL: Issues, https://github.com/BobTheBuidler/faster-eth-utils/issues
12
- Project-URL: Source, https://github.com/BobTheBuidler/faster-eth-utils
12
+ Project-URL: Source - Precompiled (.py), https://github.com/BobTheBuidler/faster-eth-utils/tree/master/faster_eth_utils
13
+ Project-URL: Source - Compiled (.c), https://github.com/BobTheBuidler/faster-eth-utils/tree/master/build
14
+ Project-URL: Benchmarks, https://github.com/BobTheBuidler/faster-eth-utils/tree/master/benchmarks
15
+ Project-URL: Benchmarks - Results, https://github.com/BobTheBuidler/faster-eth-utils/tree/master/benchmarks/results
13
16
  Project-URL: Original, https://github.com/ethereum/eth-utils
14
17
  Keywords: ethereum
15
18
  Classifier: Intended Audience :: Developers
@@ -50,7 +53,6 @@ Requires-Dist: towncrier<26,>=24; extra == "dev"
50
53
  Requires-Dist: hypothesis>=4.43.0; extra == "dev"
51
54
  Requires-Dist: mypy==1.18.2; extra == "dev"
52
55
  Requires-Dist: pytest>=7.0.0; extra == "dev"
53
- Requires-Dist: pytest-codspeed>=2.0.0; extra == "dev"
54
56
  Requires-Dist: pytest-xdist>=2.4.0; extra == "dev"
55
57
  Provides-Extra: docs
56
58
  Requires-Dist: sphinx>=6.0.0; extra == "docs"
@@ -61,8 +63,10 @@ Provides-Extra: test
61
63
  Requires-Dist: hypothesis>=4.43.0; extra == "test"
62
64
  Requires-Dist: mypy==1.18.2; extra == "test"
63
65
  Requires-Dist: pytest>=7.0.0; extra == "test"
64
- Requires-Dist: pytest-codspeed>=2.0.0; extra == "test"
65
66
  Requires-Dist: pytest-xdist>=2.4.0; extra == "test"
67
+ Provides-Extra: codspeed
68
+ Requires-Dist: pytest>=7.0.0; extra == "codspeed"
69
+ Requires-Dist: pytest-codspeed<4.3,>=4.2; extra == "codspeed"
66
70
  Dynamic: author
67
71
  Dynamic: author-email
68
72
  Dynamic: classifier
@@ -0,0 +1,53 @@
1
+ faster_eth_utils__mypyc.cpython-310-darwin.so,sha256=2Fy4uoieg_cizyqrBcsoX7aBpcukB-uHt6jf4vabx_o,1246960
2
+ faster_eth_utils/module_loading.cpython-310-darwin.so,sha256=bLw1SOeqsFEMfMD1tLz6WT2iR8Ns2StzzvhBAYS-_3M,50696
3
+ faster_eth_utils/hexadecimal.py,sha256=bPxUdJse6A3j3vF6KpnvSM2h3eRhgWSWeyicwnLdvHY,2082
4
+ faster_eth_utils/address.py,sha256=IIHlYuIz-F6-mAnRWdsD4uH5l56yVRFMokFQINao9lE,3680
5
+ faster_eth_utils/logging.py,sha256=jRuZMKo0rxDtlUxkj6MpHQw6WZbRmFjvx5mvBoE0M2w,4650
6
+ faster_eth_utils/types.cpython-310-darwin.so,sha256=sv-l2PJiEP5bSiYvP9_255DcTMM6X5VL6Ew60KpxWLM,50648
7
+ faster_eth_utils/humanize.cpython-310-darwin.so,sha256=yGMsMSrr_Oycux9D8VXtiEh7JOJnPJMDdGSMZkRZMog,50656
8
+ faster_eth_utils/applicators.py,sha256=HhajaobRZTwbUHkD-MJWjpfjh17VBiUic0-R83heLwc,5880
9
+ faster_eth_utils/units.py,sha256=jRo8p6trxwuISBnT8kfxTNVyd_TSd5vVY5aiKDefB1U,1757
10
+ faster_eth_utils/encoding.py,sha256=1qfDeuinLZ01XjYgknpm_p9LuWwaYvicYkYI8mS1iMc,199
11
+ faster_eth_utils/conversions.py,sha256=t2TEe0WsffqOFDbyQcERTSbHJYpDBWHKd8XPArhLoEE,5665
12
+ faster_eth_utils/currency.cpython-310-darwin.so,sha256=4LHEtlnMPu8z9v3GT9dUGMNiVozbPbwo1CbdVV2Ov84,50656
13
+ faster_eth_utils/__init__.py,sha256=hW-A_fjyQ76crTKwuxxSbvNzvPfW27dSlzhtOkseymg,2762
14
+ faster_eth_utils/address.cpython-310-darwin.so,sha256=889J4n44IatOuxEDNZIqDXflzo-wQZpDqwMCTKSg6zU,50656
15
+ faster_eth_utils/types.py,sha256=FHguW7kJ-MrfVnziVHQGswvvZd6CgshB90cs0l8OT5I,1578
16
+ faster_eth_utils/humanize.py,sha256=bCxXyx73NuVIDjRnpPZs7lybfrun-llC3ITy-0zZSns,4682
17
+ faster_eth_utils/pydantic.py,sha256=za0WJGWkjYQkRnMbEke7ueyhDt-kuqFmCq0Utaji46g,3393
18
+ faster_eth_utils/hexadecimal.cpython-310-darwin.so,sha256=MU8gaPAJvN8NFTddjzKmVwQbVEqk3-cAISP2meYphI0,50672
19
+ faster_eth_utils/exceptions.cpython-310-darwin.so,sha256=fZDsELclH18GPyAI75pW5jd_e8wpIfSBfwF1TVINP_k,50672
20
+ faster_eth_utils/network.cpython-310-darwin.so,sha256=6PPtYOzMcIqsY36LXmFsTvPYWS65vdFVGHrxifXE6Fk,50656
21
+ faster_eth_utils/crypto.cpython-310-darwin.so,sha256=8AgHnHwLRHXWgzI3XJE2SmhVEzdZqaZeDKs7Fi-8DkE,50656
22
+ faster_eth_utils/debug.cpython-310-darwin.so,sha256=PI69OpkblYPXF49qjfuNZ6zzaKcLG9XoJNoGF49sZ6w,50648
23
+ faster_eth_utils/numeric.cpython-310-darwin.so,sha256=2Z9215HerAPJZulIG_qIcCG-iN6Lq_0Okzhye5mPQV8,50656
24
+ faster_eth_utils/functional.py,sha256=nJTxE4_HDci0chos5mQdy05pJ8o7n0wx_o7_WCro2gI,2449
25
+ faster_eth_utils/applicators.cpython-310-darwin.so,sha256=YRJ0gLcaPygNsPwaNAbnuUMtNdCpqPxF1SJO9Oq_9Nc,50672
26
+ faster_eth_utils/crypto.py,sha256=EQgupom_TnURbLNXodwbJoKB-mHyxgOTvo8EjnSzdxw,395
27
+ faster_eth_utils/encoding.cpython-310-darwin.so,sha256=aTpc3hSFaeS27OIatHmDDy9jQLfi6MUKE-GJIQ28T9E,50656
28
+ faster_eth_utils/debug.py,sha256=0Z-tNOqgQJunS4uHeSCCH1LWLoijlH34MBh6NRrrDrk,499
29
+ faster_eth_utils/numeric.py,sha256=RrXdXI-bhhkEsz3aBtxHuGlc_2ZJvUGpvMc47wx408Y,1190
30
+ faster_eth_utils/network.py,sha256=O3yTtA93YyyZ6Obkusr_IbbcZ6upkCewN6EsAcF0Npc,2278
31
+ faster_eth_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
+ faster_eth_utils/abi.py,sha256=3pAqpKXMOcOLCD4uUUVfxBcM9H1K311dpd1Zj0Qi21g,26404
33
+ faster_eth_utils/exceptions.py,sha256=7Cjxewj4g95RxNvjNqaB2w3HGk6068V82ppCHS_S-Y0,369
34
+ faster_eth_utils/toolz.cpython-310-darwin.so,sha256=vMn8eIyFI2OuSxcdqPmzlgVguRb7kGW8dmBxTPaHpLY,50648
35
+ faster_eth_utils/functional.cpython-310-darwin.so,sha256=nawgR3qJ4SUC5d0lA823R7xLeDQ4Q2qaUsUM9uE6eUw,50672
36
+ faster_eth_utils/abi.cpython-310-darwin.so,sha256=PQMwmdSa5lreg_-r-JW8xEZsgFy0E13jlRsTwIkxkEQ,50632
37
+ faster_eth_utils/conversions.cpython-310-darwin.so,sha256=3RUbFwFNWzhYRcfPexeui-r0aRVuhe6VGWvlHCCiDrs,50672
38
+ faster_eth_utils/decorators.cpython-310-darwin.so,sha256=gisMvl62FB0fLiilV8fzCq25DmRi5BL2LOuHqTCdJ6g,50672
39
+ faster_eth_utils/currency.py,sha256=01YVV2f2GL4830jfSjnC4XhLQjTNQB-5y7vbGzaMWbM,4150
40
+ faster_eth_utils/module_loading.py,sha256=DCLM4dEh1gqr8Ny-FWwD-_pINqeHzbLSupz4ZIpCCAw,842
41
+ faster_eth_utils/units.cpython-310-darwin.so,sha256=c-ml9e3drAR3K6_B9uWrzwvOnQ-nRfx6Aorntc8fIRk,50648
42
+ faster_eth_utils/__main__.py,sha256=mH37e49q7_A0-q1ymqkq1QyYABbQHVmXeuSKIBSahO8,86
43
+ faster_eth_utils/toolz.py,sha256=1QQY-aMbZrEgJsuqR0Ajsa32C_cXrQquzViw7OkxNLU,4410
44
+ faster_eth_utils/decorators.py,sha256=yw-QgJG29WvfuObvm6Rz8-SgLls3YW4eflqLkvmItxg,3288
45
+ faster_eth_utils/curried/__init__.py,sha256=CjV5CEg0HVEWlL5Vuv6Q9dDrFkofDhzHXMhLTJwaRP0,7828
46
+ faster_eth_utils/typing/misc.py,sha256=4N5raYXFAeRGpmch6qgHrtYNCDxCJM5XtAAsJ1FSzzU,190
47
+ faster_eth_utils/typing/__init__.py,sha256=84PxIxCvEHtBb-Ik6qnGvXH4alaWbamr_zDbtlbJh3A,325
48
+ faster_eth_utils/__json/eth_networks.json,sha256=0S8HoWD6RTR6Hc0uQdQl2VHtopytIYl5NiDAzpuskBs,414773
49
+ faster_eth_utils-5.3.14.dist-info/RECORD,,
50
+ faster_eth_utils-5.3.14.dist-info/WHEEL,sha256=11kMdE9gzbsaQG30fRcsAYxBLEVRsqJo098Y5iL60Xo,136
51
+ faster_eth_utils-5.3.14.dist-info/top_level.txt,sha256=wTH6UCItCCvEEiJ9EiOrm0Kn4p4xhB7VdmmTHktoo9Y,51
52
+ faster_eth_utils-5.3.14.dist-info/METADATA,sha256=KA5SVyLFpJtW-6vAhHLz4ubMiyyBaQZP-11wjEg_rbQ,8593
53
+ faster_eth_utils-5.3.14.dist-info/licenses/LICENSE,sha256=STqznQ6A8OeJylPrTA7dlsMtH0isQQybRlnDZOKGVrM,1095
@@ -1,53 +0,0 @@
1
- faster_eth_utils__mypyc.cpython-310-darwin.so,sha256=PLchN_WYxo1RT7vzYMD9PZDQU6e-t4Sm_7_POGViOzg,1220208
2
- faster_eth_utils/module_loading.cpython-310-darwin.so,sha256=9PlDJkuDynRJjXvTBoru8NyV6fwc6sOirPU8kTTBiQI,50696
3
- faster_eth_utils/hexadecimal.py,sha256=bPxUdJse6A3j3vF6KpnvSM2h3eRhgWSWeyicwnLdvHY,2082
4
- faster_eth_utils/address.py,sha256=IIHlYuIz-F6-mAnRWdsD4uH5l56yVRFMokFQINao9lE,3680
5
- faster_eth_utils/logging.py,sha256=Gm0B2D7oDPByi-mNCEwLnl3lAU4_TJ4yc6EsOOJA8Rc,4590
6
- faster_eth_utils/types.cpython-310-darwin.so,sha256=7qAhdvovV4HjfgekqaZJxjTcqBCa0Dp-tODZh8tAX4E,50648
7
- faster_eth_utils/humanize.cpython-310-darwin.so,sha256=o7K4R851vn69vPH7OCRKuG-uP_4h6M6kV-rGMzWLZc0,50656
8
- faster_eth_utils/applicators.py,sha256=61XBoTjROcwRslkPyCExOOYb5v7FbVVIIOYfmwgJIBk,5774
9
- faster_eth_utils/units.py,sha256=jRo8p6trxwuISBnT8kfxTNVyd_TSd5vVY5aiKDefB1U,1757
10
- faster_eth_utils/encoding.py,sha256=1qfDeuinLZ01XjYgknpm_p9LuWwaYvicYkYI8mS1iMc,199
11
- faster_eth_utils/conversions.py,sha256=t2TEe0WsffqOFDbyQcERTSbHJYpDBWHKd8XPArhLoEE,5665
12
- faster_eth_utils/currency.cpython-310-darwin.so,sha256=ijRTT1IObJ5ytM8Zd8piznlzuulzFHxgFPdRrdpAi-w,50656
13
- faster_eth_utils/__init__.py,sha256=hW-A_fjyQ76crTKwuxxSbvNzvPfW27dSlzhtOkseymg,2762
14
- faster_eth_utils/address.cpython-310-darwin.so,sha256=1yYyWmYg5N-jjV1LEm-i-kI3BEFW-07Kht0JlFgKjA4,50656
15
- faster_eth_utils/types.py,sha256=-RDPzkoNhkp3dpDNK9iKzGmSQawwZ6wJ4exur0E_BuY,1519
16
- faster_eth_utils/humanize.py,sha256=bCxXyx73NuVIDjRnpPZs7lybfrun-llC3ITy-0zZSns,4682
17
- faster_eth_utils/pydantic.py,sha256=za0WJGWkjYQkRnMbEke7ueyhDt-kuqFmCq0Utaji46g,3393
18
- faster_eth_utils/hexadecimal.cpython-310-darwin.so,sha256=xDO-KoCrlQFCGerkAkhN5mG5GTWXzIszGyv2FkGx0Kc,50672
19
- faster_eth_utils/exceptions.cpython-310-darwin.so,sha256=au4eoaRNhazbhi1ke4jZ8zYGRXwF7j84fF6kNvIX-yg,50672
20
- faster_eth_utils/network.cpython-310-darwin.so,sha256=5ZSxNESfJ-msR7rk0Bpx-FfzYsa8xqrti6AXhvUjens,50656
21
- faster_eth_utils/crypto.cpython-310-darwin.so,sha256=Fe_BpA5s6dUK40WqpIsaMuExJjHScJpKU4S88N3lt1E,50656
22
- faster_eth_utils/debug.cpython-310-darwin.so,sha256=NwMMfD5wFpnztuVky06yThlJJn1JGftB3__EV41ErSw,50648
23
- faster_eth_utils/numeric.cpython-310-darwin.so,sha256=gxh6FeUs_zexaMCQKcPXIUsgGULjC88B0Lsiz8bszQA,50656
24
- faster_eth_utils/functional.py,sha256=nJTxE4_HDci0chos5mQdy05pJ8o7n0wx_o7_WCro2gI,2449
25
- faster_eth_utils/applicators.cpython-310-darwin.so,sha256=IuYLrURVFnrCnoQehHz-vEUYCx4B_uCTZqEJ1v85vd0,50672
26
- faster_eth_utils/crypto.py,sha256=EQgupom_TnURbLNXodwbJoKB-mHyxgOTvo8EjnSzdxw,395
27
- faster_eth_utils/encoding.cpython-310-darwin.so,sha256=c3Dk42YU4c0oBAOeeVkK8LvvNxLVC_cWsr-3HpHrqSA,50656
28
- faster_eth_utils/debug.py,sha256=0Z-tNOqgQJunS4uHeSCCH1LWLoijlH34MBh6NRrrDrk,499
29
- faster_eth_utils/numeric.py,sha256=RrXdXI-bhhkEsz3aBtxHuGlc_2ZJvUGpvMc47wx408Y,1190
30
- faster_eth_utils/network.py,sha256=O3yTtA93YyyZ6Obkusr_IbbcZ6upkCewN6EsAcF0Npc,2278
31
- faster_eth_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
- faster_eth_utils/abi.py,sha256=3pAqpKXMOcOLCD4uUUVfxBcM9H1K311dpd1Zj0Qi21g,26404
33
- faster_eth_utils/exceptions.py,sha256=7Cjxewj4g95RxNvjNqaB2w3HGk6068V82ppCHS_S-Y0,369
34
- faster_eth_utils/toolz.cpython-310-darwin.so,sha256=j16dI45WPoLgZRjVmcMIoQS1NZJZd9XK6zFNEH1al1g,50648
35
- faster_eth_utils/functional.cpython-310-darwin.so,sha256=k-_8U5Lp6Nq0XY6TC1hBNRwC5l5sFv0y0WY8QjgYuw4,50672
36
- faster_eth_utils/abi.cpython-310-darwin.so,sha256=Tbd835RnUmEzAqeFB5GOMjml4WedfFy5gTF7MUnTDa4,50632
37
- faster_eth_utils/conversions.cpython-310-darwin.so,sha256=H329ETbpC580jVOwyIizN5Q3c2GdFiVgBMILjF6oPTw,50672
38
- faster_eth_utils/decorators.cpython-310-darwin.so,sha256=p5wn6WPBxlQuip4aquxnr68LBxZBJ9MhMkarIA7mRGI,50672
39
- faster_eth_utils/currency.py,sha256=01YVV2f2GL4830jfSjnC4XhLQjTNQB-5y7vbGzaMWbM,4150
40
- faster_eth_utils/module_loading.py,sha256=DCLM4dEh1gqr8Ny-FWwD-_pINqeHzbLSupz4ZIpCCAw,842
41
- faster_eth_utils/units.cpython-310-darwin.so,sha256=ROvmX3o0IhLVRqrns2BkePifXdIOQquwLTjB4npjSR4,50648
42
- faster_eth_utils/__main__.py,sha256=mH37e49q7_A0-q1ymqkq1QyYABbQHVmXeuSKIBSahO8,86
43
- faster_eth_utils/toolz.py,sha256=1QQY-aMbZrEgJsuqR0Ajsa32C_cXrQquzViw7OkxNLU,4410
44
- faster_eth_utils/decorators.py,sha256=BdAz-imQIf0TlBm7Di7T05o3IC6ei-xJc7FgIOqqAyE,2145
45
- faster_eth_utils/curried/__init__.py,sha256=x_nPjvTwmXeEl5jV86RRUvudu6ks1kMUxZfbjNuGx8Y,7407
46
- faster_eth_utils/typing/misc.py,sha256=4N5raYXFAeRGpmch6qgHrtYNCDxCJM5XtAAsJ1FSzzU,190
47
- faster_eth_utils/typing/__init__.py,sha256=84PxIxCvEHtBb-Ik6qnGvXH4alaWbamr_zDbtlbJh3A,325
48
- faster_eth_utils/__json/eth_networks.json,sha256=0S8HoWD6RTR6Hc0uQdQl2VHtopytIYl5NiDAzpuskBs,414773
49
- faster_eth_utils-5.3.13.dist-info/RECORD,,
50
- faster_eth_utils-5.3.13.dist-info/WHEEL,sha256=11kMdE9gzbsaQG30fRcsAYxBLEVRsqJo098Y5iL60Xo,136
51
- faster_eth_utils-5.3.13.dist-info/top_level.txt,sha256=wTH6UCItCCvEEiJ9EiOrm0Kn4p4xhB7VdmmTHktoo9Y,51
52
- faster_eth_utils-5.3.13.dist-info/METADATA,sha256=s6MKNWkp8Bo9yKciC5RajtnB6uiZCwTJmcvTVT2Ci9I,8197
53
- faster_eth_utils-5.3.13.dist-info/licenses/LICENSE,sha256=STqznQ6A8OeJylPrTA7dlsMtH0isQQybRlnDZOKGVrM,1095