- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Style Guide for Python Code Programmers blog(Python代码的程序员的博客风格指南)
Style Guide for Python Code
Introduction
This document gives coding conventions for the Python code comprising the standard library in
the main Python distribution. Please see the companion informational PEP describing style
guidelines for the C code in the C implementation of Python [1].
This document and PEP 257 (Docstring Conventions) were adapted from Guidos original
Python Style Guide essay, with some additions from Barrys style guide [2].
This style guide evolves over time as additional conventions are identified and past
conventions are rendered obsolete by changes in the language itself.
Many projects have their own coding style guidelines. In the event of any conflicts, such project-
specific guides take precedence for that project.
A Foolish Consistency is the Hobgoblin of Little Minds
One of Guidos key insights is that code is read much more often than it is written. The
guidelines provided here are intended to improve the readability of code and make it consistent
across the wide spectrum of Python code. As PEP 20 says, Readability counts.
A style guide is about consistency. Consistency with this style guide is important. Consistency
within a project is more important. Consistency within one module or function is most important.
But most importantly: know when to be inconsistent -- sometimes the style guide just doesnt
apply. When in doubt, use your best judgment. Look at other examples and decide what looks best.
And dont hesitate to ask!
In particular: do not break backwards compatibility just to comply with this PEP!
Some other good reasons to ignore a particular guideline:
When applying the guideline would make the code less readable, even for someone who is used
to reading code that follows this PEP.
To be consistent with surrounding code that also breaks it (maybe for historic reasons) --
although this is also an opportunity to clean up someone elses mess (i
您可能关注的文档
- structural timber WPV(结构性木材的野生脊髓灰质炎病毒).pdf
- STRUCTURE AND COMPONENTS OF THE E (结构和组件的E).pdf
- Structure and Analysis of Planetary Gear Trains (的结构和分析行星齿轮火车).pdf
- Structure and Function of the Musculoskeletal (肌肉骨骼的结构和功能).pdf
- Structure and media velocity effects on (结构和媒体速度的影响).pdf
- Structure Function of GeneChip Microarrays(GeneChip微阵列的结构功能).pdf
- Structure Fundamentals SDC Publications(结构基本质素出版物).pdf
- Structure of the Solar System Cambridge (太阳系的结构剑桥).pdf
- Structure, Defects and Properties of Finished (结构、缺陷和完成的属性).pdf
- STRUCTURE IS NOT ORGANIZATION Tom Peters(组织结构不是汤姆u2022彼得斯).pdf
- Stutter No More OoCities(不再结巴OoCities).doc
- STYLE GUIDE FOR TECHNICAL REPORT WRITING(技术报告指南写作风格).pdf
- Styles 920 and 920N MechanicalT Bolted (风格920和920 n MechanicalT螺栓).pdf
- Subaru Technology Overview How(斯巴鲁技术概述).pdf
- Subgrade Design and Construction (路基设计与施工).pdf
- STX Advanced Technologies for Green Dream (STX先进技术对绿色的梦想).pdf
- Subject and countersubject detection for (主题和countersubject检测).pdf
- Sub Sea Gauges Thuemling(子海仪表Thuemling).pdf
- Subject and Verb Agreement Teachnology(主语和动词协议严格执行).pdf
- Subject Description Form PolyU(主题描述形式理大).pdf
最近下载
- 中外建筑史幻灯片.ppt VIP
- 河北高速公路集团有限公司招聘笔试题库2024.pdf
- 《景观规划设计》课件——乡村景观园林庭院设计.pptx VIP
- 风力发电设备加工项目投资计划书(参考).docx
- 人教版高中地理必修第一册第一章:宇宙中的地球大单元整体教学设计2024.docx
- 工程造价软件应用 课件 第2章 广联达BIM土建计量平台应用.pptx
- 特色校本教材——魔幻数学(一年级).docx VIP
- 2025一建《建筑工程管理与实务》考前6套模拟卷.docx VIP
- 工程勘察服务成本要素信息(2022版).pdf VIP
- 2024年秋季学期新人教版七年级上册英语课件 Unit 1 You and Me (第4课时) Section B 1a-1d.pptx VIP
文档评论(0)