Skip to content

Discussion: String Standards #166

@Qubus0

Description

@Qubus0

My feelings:
prefer double quotes over single quotes: "string", not 'string'
prefer quote escaping over single quotes : "\"hello\" world", not '"hello" world' (see comment below)
prefer single quotes around strings over quote escaping: '"hello" world', not "\"hello\" world"

prefer format strings over string concatenation and str(): "hello %s!" % place, not "hello " + place + "!", not str("hello", place)
except for very simple cases/single concatenation: "hello " + place, not "hello %s" % place

split long strings into shorter ones with string concatenation "" + "" + ..., not str("", "", ...)

print(
   "pretend that this" +
   "is a really long" +
   "message"
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions