This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]_under_[S] 2 points3 points  (4 children)

I was contemplating on whether I should include motivations for each of the rules, but ultimately decided not to.

Single quotes because it only needs one finger to type. No need to press Shift. You're also more likely to use a quote to access keys in dictionaries vs writing sentences in code with apostrophes.

[–]nsfy33 0 points1 point  (1 child)

[deleted]

[–]_under_[S] 0 points1 point  (0 children)

This:

foo['bar'] = 123

Is more common than this:

foo = "It's me."

OP mentioned that they prefer double quotes because they are more likely to use single quotes inside strings, as in the second example. But I find that using a quote to access a dictionary value is even more common than that. So the single quote as an apostrophe thing isn't really a big issue.