Skip to content

Single quotes (') or double quotes (") #4

@lukpueh

Description

@lukpueh

In Python single quotes (') and double quotes can be used (") interchangeably to designate strings. While our code-style-guidelines suggest to use triple-double-quotes (""") for docstrings, we don't have a policy for normal strings.

Please participate in this discussion to help us promote quote consistency in our projects!

I'd like to start the discussion with the following suggestion:

  • Use single quotes everywhere , unless
  • the string contains single quotes, then use double quotes.
"""What the foo? """
foo = 'bar'
baz = {'foo': foo}
if baz['foo'] == 'bar':
  print("foo's value is 'bar'")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions