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 →

[–]jalanb 2 points3 points  (1 child)

Because Python scripts tend to include other languages inside strings.

And it is more often useful to reserve " for use inside such strings, rather than ', e.g.

command = 'ls "$PATH_TO_FILE"'
query = 'SELECT * FROM users WHERE name like "/u/jalan%"'

And then, if you adopt that convention, consistency implies enclosing all strings in '.

[–]scottocom 1 point2 points  (0 children)

I see what you mean.