git://git.eng.unimelb.edu.au
/
python-guide.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19111aa
)
Update docs/writing/style.rst
author
Estevan Pequeno
<estevan.pequeno@gmail.com>
Fri, 30 Dec 2011 17:02:43 +0000
(11:02 -0600)
committer
Estevan Pequeno
<estevan.pequeno@gmail.com>
Fri, 30 Dec 2011 17:02:43 +0000
(11:02 -0600)
docs/writing/style.rst
patch
|
blob
|
history
diff --git
a/docs/writing/style.rst
b/docs/writing/style.rst
index
216c780
..
e0cf87d
100644
(file)
--- a/
docs/writing/style.rst
+++ b/
docs/writing/style.rst
@@
-7,6
+7,12
@@
Idioms
Idiomatic Python code is often referred to as being *pythonic*.
+A common idiom for creating strings is to use `join <http://docs.python.org/library/string.html#string.join>`_ on an empty string.::
+
+ letters = ['s', 'p', 'a', 'm']
+ word = ''.join(letters)
+
+This will set the value of the variable *word* to 'spam'. This idiom can be applied to lists and tuples.
Zen of Python
-------------