11\documentclass {beamer }
22% \usepackage[latin1]{inputenc}
33\usetheme {Warsaw}
4- \title [Intro to Python: Week 7]{Introduction to Python}
4+ \title [Intro to Python: Week 7]{Introduction to Python\\ More OO -- Decorators and Generators }
55\author {Christopher Barker}
66\institute {UW Continuing Education / Isilon}
77\date {August 08, 2012}
2727\section {Review/Questions }
2828
2929% ---------------------------------------------
30- \begin {frame }{Review of Previous Class}
30+ \begin {frame }[fragile] {Review of Previous Class}
3131
3232\begin {itemize }
33- \item ...
33+ \item Really Quick OO overview
34+ \item Built an html generator, using:
35+ \begin {itemize }
36+ \item A base class with a couple methods
37+ \item Subclasses overriding class attributes
38+ \item Subclasses overriding a method
39+ \item Subclasses overriding the \verb |__init__ |
40+ \end {itemize }
3441\end {itemize }
3542
3643\end {frame }
@@ -44,32 +51,95 @@ \section{Review/Questions}
4451
4552\end {frame }
4653
47- \section {First Section }
54+ \section {More OO }
4855
4956% ---------------------------------------------
50- \begin {frame }[fragile]{First Topic }
57+ \begin {frame }[fragile]{multiple inheritance }
5158
52- {\Large A topicc}
59+ {\Large Multiple inheritance:\\
60+ \hspace {0.2in} Pulling from more than one class}
5361
62+ \vfill
5463\begin {verbatim }
55- some code example
64+ class Combined(Super1, Super2, Super3):
65+ def __init__(self, something, something else):
66+ Super1.__init__(self, ......)
67+ Super2.__init__(self, ......)
68+ Super3.__init__(self, ......)
5669\end {verbatim }
70+ (calls to the super class \verb |__init__ | are optional -- case dependent)
71+
72+ \vfill
73+ {\Large Attribute resolution -- left to right}
74+
75+ \vfill
76+ ( Why would you want to do this? )
5777
5878\end {frame }
5979
60- \section {Another Section }
80+ % ---------------------------------------------
81+ \begin {frame }[fragile]{mix-ins}
82+
83+ \vfill
84+ {\Large Hierarchies are not always simple}
85+ \vfill
86+ \begin {itemize }
87+ \item Animal
88+ \begin {itemize }
89+ \item Mammal
90+ \begin {itemize }
91+ \item GiveBirth()
92+ \end {itemize }
93+ \item Bird
94+ \begin {itemize }
95+ \item LayEggs()
96+ \end {itemize }
97+ \end {itemize }
98+ \end {itemize }
99+ \vfill
100+ {\Large Where do you put a Platypus or an Armadillo?}
101+
102+ \vfill
103+ {\Large Real World Example: \verb |FloatCanvas |}
104+ \end {frame }
61105
62106% ---------------------------------------------
63- \begin {frame }[fragile]{First Topic }
107+ \begin {frame }[fragile]{properties }
64108
65- {\Large A topicc }
109+ {\Large Simple attributes: }
66110
67111\begin {verbatim }
68- some code example
112+ In [5]: class C(object):
113+ def __init__(self):
114+ self.x = 5
115+ In [6]: c = C()
116+ In [7]: c.x
117+ Out[7]: 5
118+ In [8]: c.x = 8
119+ In [9]: c.x
120+ Out[9]: 8
69121\end {verbatim }
70122
71123\end {frame }
72124
125+
126+
127+ \section {Special Methods }
128+
129+
130+ % \section{Another Section}
131+ %
132+ % % ---------------------------------------------
133+ % \begin{frame}[fragile]{First Topic}
134+ %
135+ % {\Large A topicc}
136+ %
137+ % \begin{verbatim}
138+ % some code example
139+ % \end{verbatim}
140+ %
141+ % \end{frame}
142+
73143\end {document }
74144
75145
0 commit comments