Skip to content

Commit dcfbc54

Browse files
committed
fix: Use Optional where appropriate
1 parent bbe823a commit dcfbc54

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

web3/main.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,28 +212,36 @@ def middleware_onion(self) -> MiddlewareOnion:
212212
@staticmethod
213213
@wraps(to_bytes)
214214
def to_bytes(
215-
primitive: Primitives = None, hexstr: HexStr = None, text: Optional[str] = None
215+
primitive: Optional[Primitives] = None,
216+
hexstr: Optional[HexStr] = None,
217+
text: Optional[str] = None,
216218
) -> bytes:
217219
return to_bytes(primitive, hexstr, text)
218220

219221
@staticmethod
220222
@wraps(to_int)
221223
def to_int(
222-
primitive: Primitives = None, hexstr: HexStr = None, text: Optional[str] = None
224+
primitive: Optional[Primitives] = None,
225+
hexstr: Optional[HexStr] = None,
226+
text: Optional[str] = None,
223227
) -> int:
224228
return to_int(primitive, hexstr, text)
225229

226230
@staticmethod
227231
@wraps(to_hex)
228232
def to_hex(
229-
primitive: Primitives = None, hexstr: HexStr = None, text: Optional[str] = None
233+
primitive: Optional[Primitives] = None,
234+
hexstr: Optional[HexStr] = None,
235+
text: Optional[str] = None,
230236
) -> HexStr:
231237
return to_hex(primitive, hexstr, text)
232238

233239
@staticmethod
234240
@wraps(to_text)
235241
def to_text(
236-
primitive: Primitives = None, hexstr: HexStr = None, text: Optional[str] = None
242+
primitive: Optional[Primitives] = None,
243+
hexstr: Optional[HexStr] = None,
244+
text: Optional[str] = None,
237245
) -> str:
238246
return to_text(primitive, hexstr, text)
239247

0 commit comments

Comments
 (0)