Python Forum
Best Practice For String Quotations ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best Practice For String Quotations ?
#4
(Aug-31-2017, 04:55 PM)snippsat Wrote: PEP8.org (Better CSS styled pep-8 website).
Except for the comments.  That font is barely legible.

In python, it doesn't matter.  In some languages, it does.  Php, for example, everything should be single quotes, as double quotes allow for string interpolation (the same as a python f-string), and thus take slightly longer to parse.

I prefer double-quoted.  I'm not sure I can explain why, as I frequently need to use single-quoted anyway to include xml attributes.
Reply


Messages In This Thread
Best Practice For String Quotations ? - by Zork_3 - Aug-31-2017, 04:12 PM
RE: Best Practice For String Quotations ? - by nilamo - Aug-31-2017, 05:09 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Best practice on using virtual environments in Python bytecrunch 6 1,011 Feb-14-2024, 03:22 PM
Last Post: snippsat
  best practice for import libraries and using pyinstaller aster 3 2,950 Apr-17-2021, 11:12 AM
Last Post: snippsat
  Threading best practice EvanS1 2 1,993 Apr-21-2020, 10:11 PM
Last Post: EvanS1
  How to properly close db connection, best practice t4keheart 6 3,117 Jan-24-2020, 06:58 PM
Last Post: Marbelous
  Help with string practice Hermann_Fegelein 2 2,740 Aug-15-2018, 04:56 PM
Last Post: Hermann_Fegelein

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020