faster-eth-abi 5.2.14__cp314-cp314-macosx_11_0_arm64.whl → 5.2.15__cp314-cp314-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-abi might be problematic. Click here for more details.

Binary file
@@ -2,6 +2,8 @@ import re
2
2
  from typing import (
3
3
  Any,
4
4
  Final,
5
+ Generic,
6
+ Literal,
5
7
  NewType,
6
8
  NoReturn,
7
9
  Optional,
@@ -29,7 +31,6 @@ from faster_eth_abi.exceptions import (
29
31
  ABITypeError,
30
32
  )
31
33
 
32
-
33
34
  TYPE_ALIASES: Final = {
34
35
  "int": "int256",
35
36
  "uint": "uint256",
@@ -47,6 +48,7 @@ TYPE_ALIAS_RE: Final = re.compile(
47
48
  IntSubtype = NewType("IntSubtype", int)
48
49
  FixedSubtype = NewType("FixedSubtype", Tuple[int, int])
49
50
  Subtype = Union[IntSubtype, FixedSubtype]
51
+ TSub = TypeVar("TSub", IntSubtype, FixedSubtype, Literal[None])
50
52
 
51
53
 
52
54
  @mypyc_attr(allow_interpreted_subclasses=True)
@@ -202,7 +204,7 @@ class TupleType(ABIType):
202
204
 
203
205
 
204
206
  @mypyc_attr(allow_interpreted_subclasses=True)
205
- class BasicType(ABIType):
207
+ class BasicType(ABIType, Generic[TSub]):
206
208
  """
207
209
  Represents the result of parsing a basic type string e.g. "uint", "address",
208
210
  "ufixed128x19[][2]".
@@ -213,7 +215,7 @@ class BasicType(ABIType):
213
215
  def __init__(
214
216
  self,
215
217
  base: str,
216
- sub: Optional[Subtype] = None,
218
+ sub: Optional[TSub] = None,
217
219
  arrlist: Optional[Sequence] = None,
218
220
  *,
219
221
  node: Optional[Node] = None,
@@ -334,6 +336,10 @@ class BasicType(ABIType):
334
336
  self.invalidate("address cannot have suffix")
335
337
 
336
338
 
339
+ BytesType = BasicType[IntSubtype]
340
+ FixedType = BasicType[FixedSubtype]
341
+
342
+
337
343
  def normalize(type_str: TypeStr) -> TypeStr:
338
344
  """
339
345
  Normalizes a type string into its canonical version e.g. the type string
Binary file