Object-Oriented Programming in Python

Errata for Chapter 3

This errata is for the first printing (published 29 October 2007).


Page 94, Figure 3.4
The setDepth method requires a depth as a parameter. It should appear as setDepth(depth). This error also exists on pages 22, 24, and 319.

Page 110, second line of text
Replace position in properly with position it properly

Page 115, Widget code fragment
For better looking geometry, change the second line to read
nameInput = TextBox(150, 30, Point(100,30))

Page 122, Exercise 3.5
This problem statement is flawed for two reasons. First, with the given geometry, the area of the circle is not fully contained within the area of the square, so at least part of the circle will surely show. Second, this problem was written to emphasize the importance of the depth attribute. In the original version of cs1graphics, objects with equal depths were rendered with arbitrary front-to-back ordering, and in this example, it so happened that the square would obscure the circle. However, in a subsequent release of cs1graphics, we guarantee that objects with equal depth will be drawn front-to-back according to which was most recently added. Therefore, the blue circle will indeed appear on top of the red square.