summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Burns2010-06-29 01:17:52 -0500
committerChristopher Burns2010-06-29 01:17:52 -0500
commitec8c1f74a6b3db1a21449e3cbc69aeeab96c14f0 (patch)
treeb529cd49f9dd21ea376c24dfa981b3cc4f782f4b
parent08c1e21f429674f0b887552a4ad86acd36402fe4 (diff)
downloadworkshops-more-scipy-ec8c1f74a6b3db1a21449e3cbc69aeeab96c14f0.tar.gz
workshops-more-scipy-ec8c1f74a6b3db1a21449e3cbc69aeeab96c14f0.tar.bz2
workshops-more-scipy-ec8c1f74a6b3db1a21449e3cbc69aeeab96c14f0.zip
DOC: Add comments about python style.
--HG-- branch : scipy2010
-rw-r--r--day2/session4.tex17
1 files changed, 13 insertions, 4 deletions
diff --git a/day2/session4.tex b/day2/session4.tex
index bf3c70f..a1e67de 100644
--- a/day2/session4.tex
+++ b/day2/session4.tex
@@ -252,6 +252,7 @@ if __name__ == '__main__':
\item Readability Counts!\\Code is read more often than its written.
\item Consistency!
\item Know when to be inconsistent.
+ \item Play telephone with that line of code.
\end{itemize}
\end{frame}
@@ -259,8 +260,8 @@ if __name__ == '__main__':
\begin{lstlisting}
amount = 12.68
denom = 0.05
- nCoins = round(amount/denom)
- rAmount = nCoins * denom
+ num_coins = round(amount/denom)
+ rounded_amount = num_coins * denom
\end{lstlisting}
\pause
\begin{block}{Style Rule \#1}
@@ -276,6 +277,7 @@ if __name__ == '__main__':
\item Maximum Line Length
\item Blank Lines
\item Encodings
+ \item Consider any legible book
\end{itemize}
\end{frame}
@@ -301,8 +303,15 @@ if __name__ == '__main__':
\item Ending the docstrings
\item One liner docstrings
\end{itemize}
-More information at PEP8: http://www.python.org/dev/peps/pep-0008/
-\inctime{5}
+\end{frame}
+
+\begin{frame}{The Python Style Guide}
+ \begin{itemize}
+ \item PEP8
+ \item PEP8
+ \item PEP8
+ \item \url{http://www.python.org/dev/peps/pep-0008/}
+ \end{itemize}
\end{frame}
\section{Debugging}