mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Oops, typo.
This commit is contained in:
parent
1509219cc9
commit
2505376951
@ -53,7 +53,7 @@ command.
|
|||||||
Whenever joining more than two strings, use string interpolation, not addition:
|
Whenever joining more than two strings, use string interpolation, not addition:
|
||||||
s = x + y + z # Bad.
|
s = x + y + z # Bad.
|
||||||
s = '%s%s%s' % (x, y, z) # Good.
|
s = '%s%s%s' % (x, y, z) # Good.
|
||||||
s = ''.join(x, y, z) # Best, but not as general.
|
s = ''.join([x, y, z]) # Best, but not as general.
|
||||||
This has to do with efficiency; the intermediate string x+y is made (and thus
|
This has to do with efficiency; the intermediate string x+y is made (and thus
|
||||||
copied) before x+y+z is made, so it's less efficient.
|
copied) before x+y+z is made, so it's less efficient.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user