News for hackers. Stuff that matters.
Re:Django: Reformatted code with Black by vitorfs on Tuesday February 08, 2022 @10:25AM (#30259469)
I have always used single quotes for Python code since I start working with it. When I started to adopt Black on my projects it indeed felt weird and the code looked unpleasant. But after a while you get used to it.

Some people make the case that it's easier to write single quotes (well, depending on the keyboard format anyway). For keyboards in the US standard you have to hold the Shift key to write a double quote. But the good thing about Black is that you can still write your code using single quote and when you run the command line utility it will fix/normalize the code to use double quotes.

Nowadays I got so used to it that I even write my Python code using double quotes. And looking at Python code using single quotes looks weird/unpleasant for me.

Re:Django: Reformatted code with Black by spc476 on Tuesday February 08, 2022 @08:29PM (#30267457)
I use single quotes for items that, while technically a string, could be considered a value or symbol. For example:

     syslog('debug',"Just opened %s for output",filename)
While there's no semantic difference between single and double quote, in my code base, there is. And if black becomes very popular, why even support single quotes anymore?
Re:Django: Reformatted code with Black by digisign on Tuesday February 08, 2022 @01:30PM (#30262394)
The repl still uses single quotes.