> Use double quotes for strings meant for human consumption, use single
> quotes for everything else.
>
> Text, trans strings, model verbose_names: double quotes
> Dict keys, HTML tags, flags, and similar: single quotes
>
> Use triple quotes for long blocks of text, ideally only necessary
On 29 oct. 2013, at 04:41, Andres Osinski wrote:
> Use double quotes for strings meant for human consumption, use single
> quotes for everything else.
I’m usually doing that in new code.
I don’t think it’s worth retrofitting the entire Django codebase, though.
--
I don't know where I got this from, but I consider it to be the best
convention for choosing quote types:
Use double quotes for strings meant for human consumption, use single
quotes for everything else.
Text, trans strings, model verbose_names: double quotes
Dict keys, HTML tags, flags, and
> Here's an example from the django source where we are using double quotes
> in python instead of single quotes. The following code prints out html
> using single quotes instead of the double quotes regularly seen in html.
>
> return format_html(" value='{0}' />", csrf_token)
>
> instead
Here's an example from the django source where we are using double quotes
in python instead of single quotes. The following code prints out html
using single quotes instead of the double quotes regularly seen in html.
return format_html("", csrf_token)
instead of:
return
I believe we should prefer one over the other. That being said, legibility,
consistency, and context should be taken into account.
Should our documentation examples prefer one rather over the other?
>
> Daniele
>
>
--
You received this message because you are subscribed to the Google Groups
On Sun, Oct 27, 2013, Zach Borboa wrote:
>I'm seeing a mix of both singly- and doubly-quoted strings in django source.
>Other than docstrings wrapped in triple-double-quotes, when is it
>appropriate
>to use double quotes instead single quotes?
As far as I understand it