Skip to content

Commit cb93329

Browse files
committed
cover all arg combos
1 parent 4be77d6 commit cb93329

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

mypyc/primitives/int_ops.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,20 +314,21 @@ def int_unary_op(name: str, c_function_name: str) -> PrimitiveDescription:
314314
error_kind=ERR_NEVER,
315315
)
316316

317-
# int.to_bytes(length, byteorder, *, signed=False)
317+
# int.to_bytes(length, byteorder)
318318
method_op(
319319
name="to_bytes",
320-
arg_types=[int_rprimitive, int_rprimitive, str_rprimitive, bool_rprimitive],
320+
arg_types=[int_rprimitive, int_rprimitive, str_rprimitive],
321+
extra_int_constants=[(0, bool_rprimitive)],
321322
return_type=bytes_rprimitive,
322323
c_function_name="CPyTagged_ToBytes",
323324
error_kind=ERR_MAGIC,
324325
)
325326

326-
# int.bit_length()
327+
# int.to_bytes(length, byteorder, signed)
327328
method_op(
328-
name="bit_length",
329-
arg_types=[int_rprimitive],
330-
return_type=int_rprimitive,
331-
c_function_name="CPyInt_BitLength",
329+
name="to_bytes",
330+
arg_types=[int_rprimitive, int_rprimitive, str_rprimitive, bool_rprimitive],
331+
return_type=bytes_rprimitive,
332+
c_function_name="CPyTagged_ToBytes",
332333
error_kind=ERR_MAGIC,
333334
)

0 commit comments

Comments
 (0)