Closed masonproffitt closed 5 years ago
I agree that a Row
shouldn't look like an empty iterable. However, it's unpythonic for iteration over a dict-like thing (a Row
is dict-like; that's why its .tolist()
representation is a dict) to iterate over the values, rather than the keys. I see what your example code is trying to do, but in general, it doesn't satisfy the criterion of least surprise.
Personally, I would have been much happier if iteration over dict-like things in Python was essentially items()
, rather than values()
(as you have it here) or keys()
(as it almost always is). However, we can't break pythonic conventions.
Okay, I think it seems correct now.
Sorry that I missed the fact that this is done. I just checked the tests, and they are requiring the right behavior (and pass).
Currently, iterating over a Row in a Table with columns that aren't labeled '0', '1', '2', etc., will fail, making it appear as if every Row is empty:
This is fixed here, so that the actual OrderedDict of column names will be iterated over.