Measure class, precision, significant digits, and divmod()

Ethan Furman ethan at stoneleaf.us
Wed Jul 16 00:32:30 CEST 2008


Ken Starks wrote:
> Ethan Furman wrote:
> 
>> Hey all.
>>
> <snip>
> 
>>
>> As I have mentioned before, I am making this Measure class for two 
>> reasons:  experience with unit testing, I like playing with numbers, I 
>> am unaware of anything like this having yet been done (okay, three 
>> reasons ;).
>>
> <snip>
> 
>>
>> Any and all feedback welcome, particularly from anyone who might 
>> actually use the Measure class.  ;)
>>
>> ~Ethan
> 

[snip]

> +++++++++++++++++++++++++++++++++++++++
> 
> My principal interest in your work, however, is in the use of
> unit tests as a pedagogical method of teaching programming, whether
> self-taught or taught by an instructor.
> 
> The students would be taught how to __run__ a unit test-suite
> at as early an opportunity as possible. I can't see
> why an eleven or twelve year old should not be able to cope
> with it in hour one or two of a carefully structured course.
> 
> What is needed for such an approach is a copy--in a public
> place--of your unit tests for all methods
> that are really part of the funtionality; together with
> blanked-out definitions for them (i.e just the first line,
> any in-code documentation, and 'pass' ).
> 
> You would not include any 'internal' methods that are merely the way
> __you__ happened to achieve the result.
> 
> The programming 'exercise' would then be for the students, or
> groups of students, to roll their own version until their code
> passed all the unit tests.

Definitely an interesting idea.  I'm not sure if I should be worried 
about the 12-13 year old students tackling a complex class such as a new 
number class, or if I should prepare to be embarrased by how much 
simpler they are able to make equivalent code!  ;)

At any rate, once I'm done the code will be released under a very 
friendly license, so you'll be free to do that should you desire to.

~Ethan



More information about the Python-list mailing list