Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51538

Re: PEP8 79 char max

References <mailman.5257.1375127041.3114.python-list@python.org> <51f6d9f6$0$30000$c3e8da3$5496439d@news.astraweb.com> <op.w00ajsxia8ncjz@gnudebeest> <mailman.5295.1375143127.3114.python-list@python.org> <op.w00eu0e7a8ncjz@gnudebeest>
From Joshua Landau <joshua@landau.ws>
Date 2013-07-30 03:12 +0100
Subject Re: PEP8 79 char max
Newsgroups comp.lang.python
Message-ID <mailman.5298.1375150398.3114.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 30 July 2013 01:41, Rhodri James <rhodri@wildebst.demon.co.uk> wrote:

> On Tue, 30 Jul 2013 01:11:18 +0100, Joshua Landau <joshua@landau.ws>
> wrote:
>
>  On 30 July 2013 00:08, Rhodri James <rhodri@wildebst.demon.co.uk> wrote:
>>
>>> I'm working on some shonky C code at the moment that inconsistent
>>> indentation and very long lines.  It is extremely annoying not to be
>>> able to put the original code, my "translation" and sundry utilities
>>> all side-by-side on the same screen (and it's not a particularly
>>> small screen), and having to keep flipping between them slows me
>>> down dramatically.   Long lines have no effect on the speed of the
>>> program, but they can have serious effects on the speed of the
>>> programmer.
>>>
>>
>> Then just wrap it. This is a very automatable thing for editors. There
>> might even be a clever hard-wrap somewhere. I just tried pyformat -- that
>> works wonders.
>>
>
> I tried that at first, but it actually made matters worse.  "Simple"
> word-wrapping just broke the structural cues from indentation (which I'd
> already had to instruct my editor to make at least somewhat consistent).  I
> couldn't just take in the code layout at a glance, I had to work at it.


1) pyformat's quite sane, maybe you should try that. It's a few minutes
wasted at worst. (sudo pip install pyformat; pyformat <infile> [-i for
inplace changes])

2) How does your soft word-wrap work? I know some editors do it terribly,
mine does it passably¹. I don't know any that do it truly semantically
(although it's a feature worthy of implementation).

3) Is the code secret? Let's see a "difficult" snippet if not.

¹ It either indents to the same indentation as the line's start or an extra
indent inwards, depending on context

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

PEP8 79 char max Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-29 15:43 -0400
  Re: PEP8 79 char max John Gordon <gordon@panix.com> - 2013-07-29 20:30 +0000
  Re: PEP8 79 char max Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-29 21:09 +0000
    Re: PEP8 79 char max "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2013-07-30 00:08 +0100
      Re: PEP8 79 char max Joshua Landau <joshua@landau.ws> - 2013-07-30 01:11 +0100
        Re: PEP8 79 char max "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2013-07-30 01:41 +0100
          Re: PEP8 79 char max Joshua Landau <joshua@landau.ws> - 2013-07-30 03:12 +0100
          Re: PEP8 79 char max Cameron Simpson <cs@zip.com.au> - 2013-07-31 07:32 +1000
  Re: PEP8 79 char max llanitedave <llanitedave@veawb.coop> - 2013-07-31 00:30 -0700

csiph-web