Attention is currently required from: fixeria, laforge.
neels has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/pysim/+/42260?usp=email )
Change subject: ConfigurableParameter: safer val length check ......................................................................
Patch Set 4:
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/pysim/+/42260/comment/c0effa1e_1a8846b8?usp=ema... : PS1, Line 7: Co
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.