如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
HYPERLINK"http://www.python.org/dev/peps/"PEPIndex>PEP8--StyleGuideforPythonCodePEP:8Title:StyleGuideforPythonCodeVersion:89db18c77152Last-Modified:HYPERLINK"http://hg.python.org/peps/file/tip/pep-0008.txt"2013-01-1311:28:10+0100(Sun,13Jan2013)Author:GuidovanRossum<guidoatpython.org>,BarryWarsaw<barryatpython.org>Status:ActiveType:ProcessContent-Type:HYPERLINK"http://www.python.org/dev/peps/pep-0012"text/x-rstCreated:05-Jul-2001Post-History:05-Jul-2001HYPERLINK"http://www.python.org/dev/peps/pep-0008/"\l"id7"IntroductionThisdocumentgivescodingconventionsforthePythoncodecomprisingthestandardlibraryinthemainPythondistribution.PleaseseethecompanioninformationalPEPdescribingstyleguidelinesfortheCcodeintheCimplementationofPythonHYPERLINK"http://www.python.org/dev/peps/pep-0008/"\l"id4"[1].ThisdocumentandHYPERLINK"http://www.python.org/dev/peps/pep-0257"PEP257(DocstringConventions)wereadaptedfromGuido'soriginalPythonStyleGuideessay,withsomeadditionsfromBarry'sstyleguideHYPERLINK"http://www.python.org/dev/peps/pep-0008/"\l"id5"[2].HYPERLINK"http://www.python.org/dev/peps/pep-0008/"\l"id8"AFoolishConsistencyistheHobgoblinofLittleMindsOneofGuido'skeyinsightsisthatcodeisreadmuchmoreoftenthanitiswritten.TheguidelinesprovidedhereareintendedtoimprovethereadabilityofcodeandmakeitconsistentacrossthewidespectrumofPythoncode.AsHYPERLINK"http://www.python.org/dev/peps/pep-0020"PEP20says,"Readabilitycounts".Astyleguideisaboutconsistency.Consistencywiththisstyleguideisimportant.Consistencywithinaprojectismoreimportant.Consistencywithinonemoduleorfunctionismostimportant.Butmostimportantly:knowwhentobeinconsistent--sometimesthestyleguidejustdoesn'tapply.Whenindoubt,useyourbestjudgment.Lookatotherexamplesanddecidewhatlooksbest.Anddon'thesitatetoask!Twogoodreasonstobreakaparticularrule:Whenapplyingtherulewouldmakethecodelessreadable,evenforsomeonewhoisusedtoreadingcodethatfollowstherules.Tobeconsistentwithsurroundingcodethatalsobreaksit(maybeforhist