哪些 PEP 是必读的?
我是一名相当强大的 Python 编码员,但我的风格太多有点随意,而且我确信对于许多问题,比我想出的解决方案有更多的 Pythonic 解决方案。哪些 PEP 对于精通 Python 的人来说是必不可少的?
I'm a fairly strong Python coder, but too much of my style is a little haphazard, and I'm sure there are more Pythonic solutions to many problems than the ones I come up with. Which PEPs are essential for any well versed Pythonista to read?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
绝对是 PEP 8,Python 风格指南。
Definitely PEP 8, a Style Guide for Python.
尽管Python非常直观,但很多人并不理解他的哲学。
Although Python is incredibly intuitive, a lot of people do not comprehend his philosophy.
现在是回顾性的,但仍然很有趣:我认为 Python 3000 中不会改变的事情< /a> 是一本很好的读物,其中有很多指向决策之前的讨论的链接。
It is now retrospective, but still interesting: I think Things that will Not Change in Python 3000 is a good read, with lots of links to the discussions that preceded the decisions.
另外 pep 0257 文档字符串约定
Also pep 0257 docstring convention
我发现阅读那些被拒绝的文章可以让我们深入了解什么是Pythonic、什么不是。
这是不久前的事了,所以我没有任何具体的例子。
I found that reading the declined ones can give some good insights into what's Pythonic and what isn't.
This was a while ago so I don't have any specific examples.
我还推荐 PEP 8 和 257。我知道这与最初的问题略有不同,但我想指出 PyCharm(在我看来可能是最好的 Python IDE)会自动检查您是否遵循了一些最重要的 PEP 8 指南,以防万一有人感兴趣......
I'd also recommend PEPs 8 and 257. I know this deviates slightly from the original question, but I'd like to point out that PyCharm (probably the best Python IDE around in my opinion) automatically checks if you're following some of the most important PEP 8 guidelines, just in case anyone's interested...
这是 PEP 的索引 - http://www.python.org/dev/peps/
当有人对某个主题有疑问时,他们可以在该主题中进行搜索
Here is a index of PEP - http://www.python.org/dev/peps/
when ever one has doubt about a topic, they can search in that