Re: PEP8 and 4 spaces

2014-07-03 Thread Toby Shepard

On 07/03/2014 10:46 AM, Tim Chase wrote:

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



Very interesting.  Yes, we're using Git.  Thanks for the suggestion.

Tobiah

--
https://mail.python.org/mailman/listinfo/python-list


Re: PEP8 and 4 spaces

2014-07-03 Thread Toby Shepard

On 07/03/2014 12:44 PM, Simon Ward wrote:



On 3 July 2014 18:31:04 BST, Tobiah tshep...@rcsreg.com wrote:

Coworker takes PEP8 as gospel and uses 4 spaces to indent.  I
prefer tabs.  Boss want's us to unify.


This isn't worth arguing about.


How point of view changes things.




Anyway, I gave up the 80 char line length long ago, having little
feeling for some dolt on a Weiss terminal that for some reason
needs to edit my code.


Putting the code factoring considerations aside, because others have
already mentioned them and I'm sure others will, there are some other
practical reasons for limiting line width:


All that is fine, and makes great sense.  I generally write short lines.
I know the tricks for splitting otherwise long lines into multiple readable
lines.  I'm not advocating that we use semicolons and always go past 80
characters.  I'm just saying that once in a while it makes sense to me
to do it, and I don't lose sleep when it happens.
 

I feel rather the same about the spaces and tabs, given that most
people seem to be using editors these days that are configurable to
show tabs a four characters.


Conversely, those same editors can probably automatically indent and
unindent a configurable amount of spaces. If you don't use such an
editor, and you really can't tolerate the different style, you can
use another tool to reindent your code.


It works both ways.  I'm using Vim, and it will handle the spaces
and give a tab-like experience - not quite as good, but good enough
to live with.  Either of us could give in.  The boss likes tabs,
as I do.  The coworker really only has PEP8 to point to.  There is
really nothing good about the space way, other than as I said, Notepad
users will see four space indents.  Most other users can configure the tabstop
as they like *if* tabs are being used.  The Notepad users will get by just fine.

It could fall either way.  I was just trying to nudge it toward mine.

Tobiah

--
https://mail.python.org/mailman/listinfo/python-list