Commits

Mathieu D. committed 051fba2

fix code outside code block in PythonForProgrammers

  • Participants
  • Parent commits 7da65ff

Comments (0)

Files changed (1)

File docs/PythonForProgrammers.rst

 
 - You can turn a list into function arguments using ``*``::
 
-      def f(a,b,c): print a, b, c
-      x = [1,2,3]
-      f(*x)
-      f(*(1,2,3))
+    def f(a,b,c): print a, b, c
+    x = [1,2,3]
+    f(*x)
+    f(*(1,2,3))
 
 - You can compose classes using ``import``. Here's a method that can
   be reused by multiple classes::
 
-  # PythonForProgrammers/utility.py
-      def f(self): print "utility.f()!!!"
+    # PythonForProgrammers/utility.py
+    def f(self): print "utility.f()!!!"
 
 Here's how you compose that method into a class::
 
-      # PythonForProgrammers/compose.py
-      class Compose:
-      	   from utility import f
+    # PythonForProgrammers/compose.py
+    class Compose:
+        from utility import f
 
-      Compose().f()
+    Compose().f()
 
 - Basic functional programming with ``map()`` etc.