Attention is currently required from: fixeria, laforge.
1 comment:
Commit Message:
needs --verbose commit log, I'm not understanding why the new code is safer.
We call len(), which is implemented via a `__len__()` attribute.
If you run len() on something without a `__len__()`, then the program crashes -- but we just want to do treat non-lists like an empty list (IIRC)
In python there is no plain way to determine whether a class is a list type, the easiest is to make sure a `__len__` function is present before calling len(). If there is no `__len__` then set a local variable to 0. using that is safe.
To view, visit change 42260. To unsubscribe, or for help writing mail filters, visit settings.