google python代码规范 百度云_google的python编码规范.pdf

google的python编码规范

Google Python Style Guide

Revision 2.19

Amit Patel

Antoine Picard

Eugene Jhong

Jeremy Hylton

Matt Smart

Mike Shields

Each style point has a summary for which additional information is available by toggling the accompanying

arrow button that looks this way:?. You may toggle all summaries with the big arrow button:

? Toggle all summaries

Table of Contents

Python

Language

Rules

pychecker Imports Packages Exceptions Global variables Nested/Local/Inner Classes and

FunctionsList Comprehensions Default Iterators and Operators Generators Lambda

FunctionsDefault Argument Values Properties True/False evaluations Deprecated

Language FeaturesLexical Scoping Function and Method Decorators Threading Power

Features

Python

Style Rules

Semicolons Line length Parentheses Indentation Blank Lines Whitespace Python

InterpreterComments Classes Strings TODO Comments Imports

formatting Statements Access Control NamingMain

Important Note

Displaying Hidden Details in this Guide

link▽

This style guide contains many details that are initially hidden from view. They are marked by the

triangle icon, which you see here on your left. Click it now. You should see "Hooray" appear

below.

Hooray! Now you know you can expand points to get more details. Alternatively, there's a "toggle

all" at the top of this document.

Background

Python is the main scripting language used at Google. This style guide is a list of dos and don'ts

for Python programs.

To help you format code correctly, we've created a settings file for Vim. For Emacs, the default

settings should be fine.

Python Language Rules

pychecker

link▽

Run pychecker over your code.

Definition:PyChecker is a tool for finding bugs in Python source code. It finds problems that are

typically caught by a compiler for less dynamic languages like C and C++. It is similar to lint.

Because of the dynamic nature of Python, some warnings may be incorrect; however, spurious

warnings should be fairly infrequent.

Pros

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值