咋样才能让python写起来更像python?

我最喜欢的两个。让代码看起来更自然。List Comprehensionb_list = Decoratorsdef login_required(func): def inner(user): if cond(user): return func(user) else return ERROR return inner()@login_requireddef view_page(user): do_something()@login_requireddef new_post(user): do_something()
■网友
import this
■网友
Python大牛David Goodger的经典文章正是解答你问题的最好答案,具体见Code Like a Pythonista: Idiomatic Python (http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html)
■网友
格式化大脑,重装系统。


    推荐阅读