Python PEP8 编码规范中文版

原文链接:https://legacy.python.org/dev/peps/pep-0008/

参考:https://blog.csdn.net/ratsniper/article/details/78954852

Code lay-out 代码布局

    Indentation 缩进
    Tabs or Spaces 制表符还是空格
    Maximum Line Length 行的最大长度
    Should a line break before or after a binary operator 在二元运算符之前应该换行吗
    Blank Lines 空行
    Source File Encoding 源文件编码
    Imports 导入
    Module level dunder names 模块级的呆名
    String Quotes 字符串引号

Whitespace in Expressions and Statements 表达式和语句中的空格

    Pet Peeves 不能忍受的事情
    Other Recommendations 其他建议

Comments 注释

    Block Comments 块注释
    Inline Comments 行内注释
    Documentation Strings 文档字符串

Naming Conventions 命名规范

    Overriding Principle 最重要的原则
    Descriptive Naming Styles 描述命名风格
    Prescriptive Naming Conventions 约定俗成命名约定
        Names to Avoid 应避免的名字
        Package and Module Names 包名和模块名
        Class Names 类名
        Exception Names 异常名
        Global Variable Names 全局变量名
        Function Names 函数名
        Function and method arguments 函数和方法参数
        Method Names and Instance Variables 方法名和实例变量
        Constants 常量
        Designing for inheritance 继承的设计
    Public and internal interfaces 公共和内部的接口

Programming Recommendations 编程建议

    Function Annotations 功能注释

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值