kyosohma at gmail.com writes: > methodList = [str for str in names if callable(getattr(obj, str))] > > instead, do something like this: > > methodList = [i for i in names if callable(getattr(obj, i))] or: methodList = list(str for str in names if callable(getattr(obj, str))) genexps, unlike listcomps, make a new scope for their index variable.