3 ms·
After letting it steep overnight, I came up with this variant which addresses most of the issues that have come up in this thread: try: result = '' w
by kd5bjo 8y ago
After letting it steep overnight, I came up with this variant which addresses most of the issues that have come up in this thread:
try:
result = ''
while (b = next(file_bytes_iterator)) != '\0':
result += b
# maybe parse more of the file here
except StopIteration:
throw ValueError("Unexpected end of file")