Stricter Whitespace Enforcement by Guido van Rossum。

  • All code indented with four spaces. This will also get rid of the tabs problem!
  • No redundant parentheses allowed (e.g. no "return(1)" where "return 1" would do).
  • No whitespace immediately following a left parentheses or immediately before a right parenthesis.
  • No whitespace before a left parenthesis that starts an argument list, or before a left square bracket that starts an index expression (e.g. "x[y]").
  • No whitespace before a comma or semicolon.
  • Exactly one space required after a comma or semicolon (except when at the end of a line).
  • No semicolon at the end of a line (it's redundant).
  • More than one consecutive space within an expression is never allowed.
  • Asignment and comparison operators must be surrounded by spaces.
  • The amount of whitespace on both sides of a binary operator should be the same.
  • If variable amounts of whitespace are used within an expression, this should correspond to the relative priorities of the operators used. For example: "1*2 + 3*4" is okay but "1*2 + 3 * 4" is not. However, "1*2+3*4" is still encouraged.
  • No space allowed before a colon.
  • In a dictionary display, exactly one space required after a colon. In a slice, none.
  • The short form of a block ("if x: y") is abandoned; you must use the newline-plus-indentation form.

PEP8 也真的差不多是這樣。噢,不要啦,我超喜歡用兩個空白來縮排的 ^^;

不過,月曆上 4/1 發佈的消息都得確認再三 :p 過幾天再看看是怎樣。

Posted by yungyuc at 07:43, 0 comment, 0 trackback.
Add a trackback
Add a comment

Your name. (required)

Your personal website. (optional)

Your email address. Will not show in page. (suggested, but optional)

Text format is "Plain Text".

Enter "KrBDh"
© hover year to navigate month: powered by django