Don't use built-ins as variable names. Your code will work if you change this: > methodList = [str for str in names if callable(getattr(obj, str))] to this: > methodList = [s for s in names if callable(getattr(obj, s))]