[Edu-sig] LinuxFest and IPython

David Handy david at handysoftware.com
Tue Apr 20 20:41:15 EDT 2004


On Tue, 20 Apr 2004, Kirby Urner wrote:

> My talk was pretty short.  I was partly testing out this way of doing
> Powerpoint slides (using Impress/Open Office) where you evolve a class
> through several modules, each inheriting from the previous one, so that (a)
> at each level you get working code and (b) it all fits on one slide each
> time.
> 
> Like, with a rational number class (Q), I'll put the __init__ and __repr__
> in version 1, then go 'class Q(qv1.Q):' to inherit from it in the next
> module, adding __add__ , __neg__ , and __sub__.  Then in the next module
> I'll go 'class Q(qv2.Q):' and add __div__ to the 3rd version -- like that.
> Each successive version inherits the same __init__, along with other
> features of the parents.
> 
> This is a way to get around a standard text book problem of elaborating
> code.  Do you repeat the whole code swatch, making it longer each time?
> With inheritance, you don't repeat, just inherit.  But of course one
> wouldn't necessarily want to code this way for real -- it's more just a way
> to demonstrate the concepts. 

Interesting approach. What concept were you demonstrating?





More information about the Edu-sig mailing list