Update docs/writing/style.rst
authorEstevan Pequeno <estevan.pequeno@gmail.com>
Fri, 30 Dec 2011 17:02:43 +0000 (11:02 -0600)
committerEstevan Pequeno <estevan.pequeno@gmail.com>
Fri, 30 Dec 2011 17:02:43 +0000 (11:02 -0600)
docs/writing/style.rst

index 216c780..e0cf87d 100644 (file)
@@ -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
 -------------