python的列表过滤

python的列表过滤
    methodList = [method for method in dir(object) if callable(getattr(object, method))]
如果了解shell的话,这个将很好理解:
for method in dir(object)
do
    if [ callable(getattr(object, method)) ];then
        print $method
    fi
done