Skip to content

Commit b1e9612

Browse files
committed
cleaned up session 7
1 parent 1d2f2a0 commit b1e9612

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

Examples/Session01/schedule.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ week 6: Adam Hollis
1818
week 6: Nachiket Galande
1919
week 6: Paul A Casey
2020
week 7: Charles E Robison
21-
week 7: Paul S Briant
2221
week 7: Paul Vosper
22+
week 8: Paul S Briant
2323
week 8: Brandon Chavis
2424
week 8: Jay N Raina
2525
week 8: Josh Hicks

slides_sources/source/session07.rst

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. include:: include.rst
22

33
***************************
4-
Object Oriented programming
4+
Object Oriented Programming
55
***************************
66

77
================
@@ -27,8 +27,6 @@ Lightning Talks today
2727
|
2828
| Charles E Robison
2929
|
30-
| Paul S Briant
31-
|
3230
| Paul Vosper
3331
|
3432
@@ -110,7 +108,8 @@ Python is a Dynamic Language
110108
That clashes with "pure" OO
111109

112110
Think in terms of what makes sense for your project
113-
-- not any one paradigm of software design.
111+
112+
-- not any one paradigm of software design.
114113

115114

116115
.. nextslide::
@@ -309,8 +308,10 @@ Does this look familiar from C-style procedural programming?
309308

310309
.. nextslide::
311310

312-
Anything assigned to a ``self.`` attribute is kept in the instance
313-
name space -- ``self`` *is* the instance.
311+
Anything assigned to a ``self`` attribute is kept in the instance
312+
name space
313+
314+
-- ``self`` *is* the instance.
314315

315316
That's where all the instance-specific data is.
316317

@@ -390,6 +391,9 @@ Huh???? I only gave 2
390391

391392
LAB
392393
----
394+
.. rst-class:: medium
395+
396+
We now know enough to do something useful.
393397

394398
Let's say you need to render some html...
395399

@@ -414,9 +418,7 @@ Lightning Talks
414418
.. rst-class:: medium
415419

416420
|
417-
| Charles E Robison
418-
|
419-
| Paul S Briant
421+
| Charles E Robisons
420422
|
421423
| Paul Vosper
422424
|
@@ -506,7 +508,7 @@ Here's a program design suggestion:
506508

507509
"""
508510

509-
Whenever you override a method, the interface of the new method should be the same as the old. It should takethe same parameters, return the same type, and obey the same preconditions and postconditions.
511+
Whenever you override a method, the interface of the new method should be the same as the old. It should take the same parameters, return the same type, and obey the same preconditions and postconditions.
510512

511513
If you obey this rule, you will find that any function designed to work with an instance of a superclass, like a Deck, will also work with instances of subclasses like a Hand or PokerHand. If you violate this rule, your code will collapse like (sorry) a house of cards.
512514

@@ -574,7 +576,7 @@ When to Subclass
574576

575577
.. nextslide::
576578

577-
"Is a" vs "Has a"
579+
"**Is** a" vs "**Has** a"**
578580

579581
You may have a class that needs to accumulate an arbitrary number of objects.
580582

@@ -705,16 +707,17 @@ LAB
705707

706708
* html renderer: let's see how much more we can do!
707709

708-
:ref:`exercise_html_renderer`
710+
.. rst-class:: left
709711

712+
:ref:`exercise_html_renderer`
710713

711-
Now we have a base class, and we can:
714+
Now we have a base class, and we can:
712715

713-
* Subclass overriding class attributes
714-
* Subclass overriding a method
715-
* Subclass overriding the ``__init__``
716+
* Subclass overriding class attributes
717+
* Subclass overriding a method
718+
* Subclass overriding the ``__init__``
716719

717-
These are the core OO approaches
720+
These are the core OO approaches
718721

719722

720723
===================
@@ -807,7 +810,7 @@ Where do you put a Platypus?
807810

808811
Real World Example: `FloatCanvas`_
809812

810-
.. _FloatCanvas: https://github.com/svn2github/wxPython/blob/master/3rdParty/FloatCanvas/floatcanvas/FloatCanvas.py#L485
813+
.. _FloatCanvas: https://github.com/wxWidgets/wxPython/blob/master/wx/lib/floatcanvas/FloatCanvas.py#L485
811814

812815

813816
``super()``
@@ -862,7 +865,7 @@ Homework
862865

863866
Complete your html renderer.
864867

865-
Watch those videos:
868+
Watch these videos:
866869

867870
Python class toolkit: *Raymond Hettinger* -- https://youtu.be/HTLu2DFOdTg
868871

0 commit comments

Comments
 (0)