summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Burns2010-06-29 01:40:24 -0500
committerChristopher Burns2010-06-29 01:40:24 -0500
commitada8d86c687705e2ed7d7c0061b39a8f5c7e0030 (patch)
tree64d47d846d20a45403e96c6c373978b21e6f3894
parentb8188df9456c85e3bbe18a7e5a6633e89e96758e (diff)
downloadworkshops-ada8d86c687705e2ed7d7c0061b39a8f5c7e0030.tar.gz
workshops-ada8d86c687705e2ed7d7c0061b39a8f5c7e0030.tar.bz2
workshops-ada8d86c687705e2ed7d7c0061b39a8f5c7e0030.zip
DOC: More slides on whitespace.
--HG-- branch : scipy2010
-rw-r--r--day2/session4.tex25
1 files changed, 25 insertions, 0 deletions
diff --git a/day2/session4.tex b/day2/session4.tex
index a1e67de..21dbdcb 100644
--- a/day2/session4.tex
+++ b/day2/session4.tex
@@ -289,6 +289,31 @@ if __name__ == '__main__':
\end{itemize}
\end{frame}
+\begin{frame}[fragile]
+ \frametitle{Whitespace}
+ Whitespace... it's not just for compilers!
+ \begin{lstlisting}
+
+def myfanfunc(somevar,another,yetmore):
+ if a%b==0:return b
+ return myfanfunc(b,a%b)
+
+ \end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]
+ \frametitle{Whitespace}
+ The compiler doesn't care! Humans do!
+ \begin{lstlisting}
+
+def my_fan_func(some_var, another, yet_more):
+ if a % b == 0:
+ return b
+ return my_fan_func(b, a % b)
+
+ \end{lstlisting}
+\end{frame}
+
\begin{frame}{Comments}
\begin{itemize}
\item No comments better than contradicting comments