All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Marco Liebel" <quic_mliebel@quicinc.com>,
	qemu-devel@nongnu.org, "Taylor Simpson" <tsimpson@quicinc.com>,
	"Cleber Rosa" <crosa@redhat.com>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Beraldo Leal" <bleal@redhat.com>
Subject: Re: [PATCH] Use f-strings in python scripts
Date: Thu, 16 Mar 2023 07:07:21 +0100	[thread overview]
Message-ID: <87wn3hw7om.fsf@pond.sub.org> (raw)
In-Reply-To: <CAFn=p-YH0Ak6nmFygvBHQA5CMcF0LrZMSNcwmKAgtWRm-Ydjng@mail.gmail.com> (John Snow's message of "Wed, 15 Mar 2023 19:40:54 -0400")

John Snow <jsnow@redhat.com> writes:

[...]

> Until then, docstrings should use triple-double quotes. Any other
> string can use whatever quoting style happens to be most convenient
> for the string being written to minimize escaping. Consistency is nice
> where reasonable, but minimizing escapes by using different styles on
> an as-needed basis is a respectable and good thing.
>
> I glanced *very quickly* at these files and it looks like the style is
> to use double quotes for format strings and single quotes for constant
> strings. That seems fine to me.

I agree, and so does PEP 8:

    String Quotes

    In Python, single-quoted strings and double-quoted strings are the
    same.  This PEP does not make a recommendation for this.  Pick a
    rule and stick to it.  When a string contains single or double quote
    characters, however, use the other one to avoid backslashes in the
    string.  It improves readability.

    For triple-quoted strings, always use double quote characters to be
    consistent with the docstring convention in PEP 257.

[...]



      reply	other threads:[~2023-03-16  6:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 17:25 [PATCH] Use f-strings in python scripts Marco Liebel
2023-03-14 17:53 ` Taylor Simpson
2023-03-14 20:43   ` Marco Liebel
2023-03-15  7:43 ` Philippe Mathieu-Daudé
2023-03-15 11:16   ` Daniel P. Berrangé
2023-03-15 12:13     ` Philippe Mathieu-Daudé
2023-03-15 23:40       ` John Snow
2023-03-16  6:07         ` Markus Armbruster [this message]

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=87wn3hw7om.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=crosa@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quic_mliebel@quicinc.com \
    --cc=tsimpson@quicinc.com \
    --cc=wainersm@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.