3 ms·
The issue is the readBlah() methods. What should they do when they can't read anything? They can return either 0 or an empty result (non-special falsy value), r
by mehrdadn 8y ago
The issue is the readBlah() methods. What should they do when they can't read anything? They can return either 0 or an empty result (non-special falsy value), return -1 (special truthy value), return None (special falsy value), or raise an exception. In this case it seems they chose the first option, but this is at odds with something like next(iterator), which similar but raises an exception. It's not clear to me which is the proper pattern anymore, now that they're encouraging assignment.