File tree Expand file tree Collapse file tree 4 files changed +28
-8
lines changed
Expand file tree Collapse file tree 4 files changed +28
-8
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,12 @@ def siever(s):
3030 return siever
3131
3232s = [1 , 2 , 3 , 4 ]
33+ print "s:" , s
3334oddsieve = sieve (odd )
34- print oddsieve (s )
35+ print "oddsieve(s):" , oddsieve (s )
36+
3537evensieve = sieve (even )
36- print evensieve (s )
38+ print "evensieve(s):" , evensieve (s )
3739
3840# The decorator operator @ abbreviates the preceding pattern
3941# @f; def g means g = f(g)
@@ -46,9 +48,11 @@ def osieve(i):
4648def esieve (i ):
4749 return not (i % 2 )
4850
51+ print "osieve(s):" , osieve (s )
52+ print "esieve(s):" , esieve (s )
53+
54+
4955
50- print osieve (s )
51- print esieve (s )
5256
5357# You can also use a class as a decorator
5458# because classes and objects are callable (via __init__ and __call__)
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ """
4+ simple file to try out debugger
5+ """
6+
7+ a = "aaa"
8+ b = "bbb"
9+ c = "ccc"
10+ final = a + b + c
11+ print final
12+
Original file line number Diff line number Diff line change @@ -301,11 +301,13 @@ \section{Decorators}
301301
302302\begin {itemize }
303303 \item Re-write the properties from last week's \verb |Circle | class to use the
304- decorator syntax (see a couple slides back for an example)
305-
304+ decorator syntax (see a couple slides back for an example)\\
305+ (\verb |circle.py | and \verb |test_circle.py |)
306+ \vspace {0.5in}
306307 \item Write a decorator that can be used to wrap any function that returns a
307308 string in a \verb |<p> | element from the html builder from the previous
308- couple classes (the \verb |P Element | subclass).
309+ couple classes (the \verb |P Element | subclass).\\
310+ (\verb |html_gen.py |)
309311\end {itemize }
310312
311313\end {frame }
@@ -465,10 +467,12 @@ \section{Debugging}
465467Standard library logging module
466468
467469\vfill
468- powerful , awesome, and a bit annoying
470+ Powerful , awesome, and a bit annoying
469471
470472\vfill
471473\url {http://docs.python.org/library/logging.html}
474+
475+ \vspace {0.25in}
472476\url {http://docs.python.org/howto/logging.html#logging-basic-tutorial}
473477
474478\end {frame }
You can’t perform that action at this time.
0 commit comments