码迷,mamicode.com
首页 > 编程语言 > 详细

Learning the "PEP 8 -- Style Guide for Python Code" - part 1

时间:2020-11-17 13:01:45      阅读:27      评论:0      收藏:0      [点我收藏+]

标签:ack   python   ror   bsp   OLE   section   err   -o   nta   

PEP 8 -- Style Guide for Python Code

 

Tabs or Spaces?

Spaces are the preferred indentation method.

Tabs should be used solely to remain consistent with code that is already indented with tabs.

Python 3 disallows mixing the use of tabs and spaces for indentation.

Python 2 code indented with a mixture of tabs and spaces should be converted to using spaces exclusively.

When invoking the Python 2 command line interpreter with the -t option, it issues warnings about code that illegally mixes tabs and spaces. When using -tt these warnings become errors. These options are highly recommended!

 

Comments:

No more agree then unify the code !

Learning the "PEP 8 -- Style Guide for Python Code" - part 1

标签:ack   python   ror   bsp   OLE   section   err   -o   nta   

原文地址:https://www.cnblogs.com/eesky/p/13962494.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!