3 ms·
These seem to be relatively thin wrappers around existing APIs. A more typical way to read from a file-like object is argumentless .read() to get all content,
by duckerude 8y ago
These seem to be relatively thin wrappers around existing APIs.
A more typical way to read from a file-like object is argumentless .read() to get all content, or iterating over it to get it line by line, but if you're passing an argument to .read you're doing something fairly low-level anyway.
EAFP is already violated in a few cases where it makes more sense. This doesn't add new violations, it adds a cleaner way to work with them.