From: "W. Trevor King" <wking@tremily.us>
To: William Giokas <1007380@gmail.com>
Cc: Felipe Contreras <felipe.contreras@gmail.com>, git@vger.kernel.org
Subject: Re: Conforming to pep8
Date: Fri, 9 May 2014 09:01:30 -0700 [thread overview]
Message-ID: <20140509160130.GA28634@odin.tremily.us> (raw)
In-Reply-To: <20140509074402.GE9051@wst420>
[-- Attachment #1: Type: text/plain, Size: 1424 bytes --]
On Fri, May 09, 2014 at 02:44:02AM -0500, William Giokas wrote:
> Maybe a time to use something like::
>
> from mercurial import foo \
> bar \
> baz \
> ...
>
> Would make that import into quite a few lines, but would help organize
> things and let you easily organize things in the future.
From PEP 8 [1]:
The preferred way of wrapping long lines is by using Python's
implied line continuation inside parentheses, brackets and
braces. Long lines can be broken over multiple lines by wrapping
expressions in parentheses. These should be used in preference to
using a backslash for line continuation.
So I prefer something like:
from mercurial import (
bar,
baz,
foo,
)
The indentation for the closing parenthesis is optional [2]. You can
of course do things like:
from mercurial import (
bar, baz,
foo,
)
but I prefer the complete specification of “single, alphebetized entry
per line”. I'm happy to send patches if that style is ok.
Cheers,
Trevor
[1]: http://legacy.python.org/dev/peps/pep-0008/#maximum-line-length
[2]: http://legacy.python.org/dev/peps/pep-0008/#indentation
--
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-05-09 16:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 1:54 Conforming to pep8 William Giokas
2014-05-09 2:09 ` Jonathan Nieder
2014-05-09 14:33 ` Michael Haggerty
2014-05-09 2:10 ` Felipe Contreras
2014-05-09 3:57 ` William Giokas
2014-05-09 4:36 ` Felipe Contreras
2014-05-09 5:16 ` William Giokas
2014-05-09 7:18 ` Felipe Contreras
2014-05-09 7:28 ` William Giokas
2014-05-09 7:35 ` Felipe Contreras
2014-05-09 7:44 ` William Giokas
2014-05-09 16:01 ` W. Trevor King [this message]
2014-05-09 16:14 ` Felipe Contreras
2014-05-09 8:05 ` John Keeping
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140509160130.GA28634@odin.tremily.us \
--to=wking@tremily.us \
--cc=1007380@gmail.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).