PEP8 and 4 spaces

Tim Chase python.list at tim.thechases.com
Thu Jul 3 19:46:46 CEST 2014


> Any evidence out there that this part of PEP8 is becoming
> more optional or even obsolete, as I've heard others
> say about the 80 char line length?
> 
> Just need ammo for when the hammer of code
> unification comes down.

I'm not sure you'll get a whole lot of "PEP8 is optional or
obsolete", though some may protest the 80-char suggestion.

While I prefer tabs for similar reasons you present (I can set them
to display at whatever width is comfortable), I have Vim configured
to expand tabs into spaces so that my code conforms to standards.

If you're really picky about it, just create hooks in your VCS (you
ARE using revision control, right?) that turn
$STANDARD_NUMBER_OF_SPACES into a tabs at checkout, and then revert
tabs back to that number of spaces pre-commit.  For git, this SO
post covers it:

http://stackoverflow.com/questions/2316677/can-git-automatically-switch-between-spaces-and-tabs

-tkc






More information about the Python-list mailing list