
Aug. 10, 2009
3:38 p.m.
Nick Coghlan <ncoghlan@...> writes:
int.to_bytes(data, *, size=0, little_endian=None, signed=True)
It would be better IMO if this method belonged to the target type, so that you can write `bytearray.from_int()` without going through an intermediate bytes object. What if `data` is equal to 0? Does it return an empty bytes object? It doesn't look dangerous to do so, so I'd say go for it.