Life, code and music.
Links


Articles
Archives
09.1003.06
06.1002.06
02.1001.06
11.0912.05
08.0911.05
03.0909.05
12.0808.05
11.0807.05
10.0806.05
03.0805.05
01.0804.05
11.0703.05
10.0702.05
08.0701.05
07.0712.04
06.0703.04
05.0702.04
11.0610.03
08.0609.03
04.06 
10.18.2003

Python (Monty)

"Because Kilimanjaro is a pretty tricky climb you know. Most of it's up until you reach the very very top, and then it tends to slope away rather sharply..."

Been banging around Python a bit. It's certainly a different feel than the classic Java/C++/C#/Delphi OO paradigm that I've been used to. I've finally gotten a basic class and unit test up and running. It's a pretty simple rectangle/area thing, but it works and it gets me one step closer to understanding Python.

I also got PyUnit to work and did some Test First coding. I actually found a bug in my dinky little rectangle class. I had wanted it to throw an exception when I set width or height to a negative number, so I wrote tests to expect an error for setWidth, setHeight and the __init__ method. But when I wrote the code, I forgot to check the input for the constructor. Fortunately, PyUnit caught the oversight. Bad job Peter; good job PyUnit.

Meanwhile, I'm watching classic Monty Python sketches as I work. Perfectly appropriate I think, but it makes it more difficult to concentrate.

More on Python over the weekend, as I progress.


Post a Comment

<< Home


Powered by Blogger

© 2001-2005 20six20