搜索关键字:
- python idioms
- site:legacy.python.org list comprehension
- site:legacy.python.org Generator Expressions
参考链接:
http://seanlin.logdown.com/posts/239883-python-idioms
==
- http://seanlin.logdown.com/posts/207502-python-idioms-5-conditional-expressions
- http://seanlin.logdown.com/posts/210861-python-idioms-8-too-long
- http://seanlin.logdown.com/posts/221168-python-idioms-9-for-loop-can-have-else
- http://seanlin.logdown.com/posts/221180-python-idioms-join-for-12-strings
- http://seanlin.logdown.com/posts/221362-python-idioms-14-property
- http://seanlin.logdown.com/posts/221498-python-idioms-16-underscore
- http://seanlin.logdown.com/posts/231390-python-idioms-17-list-comprehensions
- http://seanlin.logdown.com/posts/231468-python-idioms-18-generator-expressions
http://www.jeffknupp.com/blog/2014/05/28/a-nice-little-bit-of-python/ - http://seanlin.logdown.com/posts/237383-love-with-python-idioms-19-bif
- http://seanlin.logdown.com/posts/238476-python-idioms-21-dictsetdefault
- http://seanlin.logdown.com/posts/238478-python-idioms-22-defaultdict
- http://seanlin.logdown.com/posts/238863-python-idioms-25-import-order
==
更多参考链接:
- http://legacy.python.org/dev/peps/pep-0008/
- http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html
- http://intermediate-and-advanced-software-carpentry.readthedocs.org/en/latest/idiomatic-python.html
- http://safehammad.com/downloads/python-idioms-2014-01-16.pdf
- https://docs.python.org/2/howto/doanddont.html
- https://github.com/quantifiedcode/python-anti-patterns/
- http://docs.quantifiedcode.com/python-anti-patterns/index.html
- =
- http://stackoverflow.com/questions/101268/hidden-features-of-python
- http://legacy.python.org/dev/peps/pep-0008/#programming-recommendations
- =
- http://www.norvig.com/python-iaq.html
- http://pythonic.zoomquiet.io/data/20071017193806/index.html
搜索关键字2:
- Python Complexity
- Python speed Complexity
- Python performance Complexity
- Python Efficiency
- Python idioms performance
- Python idioms speed
- Python idioms Complexity
参考链接2:
- Python Idioms and Efficiency 1/28/07 by Patrice Neff
- PythonSpeed – Python Wiki
- PythonSpeed/PerformanceTips
- TimeComplexity – Python Wiki
- Complexity of Python Operations #Nice
- =
- http://www.jeffknupp.com/blog/2012/10/04/writing-idiomatic-python/
- http://stackoverflow.com/questions/7165465/optimizing-python-code
- =
- http://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do-in-python
《 “Python惯用语小节” 》 有 3 条评论
符合语言习惯的 Python 优雅编程技巧
https://mp.weixin.qq.com/s/ENZKTzxkhP5ZoRX9QMMDxg
http://lovesoo.org/pythonic-python-programming.html
`
0. 程序必须先让人读懂,然后才能让计算机执行。
1. 交换赋值
2. Unpacking
3. 使用操作符in
4. 字符串操作
5. 字典键值列表
6. 字典键值判断
7. 字典 get 和 setdefault 方法
8. 判断真伪
9. 遍历列表以及索引
10. 列表推导
11. 列表推导-嵌套
12. 循环嵌套
13. 尽量使用生成器代替列表
14. 中间结果尽量使用imap/ifilter代替map/filter
15. 使用any/all函数
16. 属性(property)
17. 使用 with 处理文件打开
18. 使用 with 忽视异常(仅限Python 3)
19. 使用 with 处理加锁
`
如何用PEP 8编写优雅的Python代码
https://mp.weixin.qq.com/s/fYLU4zXOT3WTUmyMOeRYRg
https://realpython.com/python-pep8/
你想要的Python编程技巧,我都给你整理好了
https://mp.weixin.qq.com/s/WntwsT53KlGgBLzxJUqJFA
https://medium.freecodecamp.org/an-a-z-of-useful-python-tricks-b467524ee747
https://ai.yanxishe.com/page/TextTranslation/948