8. Ints and casts#
fromPython reads any int (__index__ too) and raises OverflowError with the parameter's name and the type's range, also past 64 bits. So the parameter type is the check: fd: i32, len: u32, offset: u64. When one value is read as two types or checked against state, const index = try py.narrow(u32, fd, "close(fd)withdirect=True");. @intCast / @truncate are for values the code itself bounds, each with a // cast: <why it fits> comment (tool/check.py rejects one without). Constants wider than c_long are fine (pub const ALL_ONES: u64 = maxInt(u64)).