'Test and demonstrate ability to override methods'

def test_namedtuple_override(self):

    class HypotPoint(namedtuple('Point', 'x    y'), ):
        @property
        def hypot(self):
            return (((self.x ** 2) + (self.y ** 2)) ** 0.5)
        def __str__(self):
            return ('Point:    x=%6.3f    y=%6.3f    hypot=%6.3f' % (self.x, self.y, self.hypot))
    p1 = HypotPoint(3, 4)
    p2 = HypotPoint(14, 5)
    p3 = HypotPoint((9.0 / 7), 6)
    self.assertEquals(p1.hypot, 5.0)
    self.assertAlmostEquals(p2.hypot, 14.866068747318506)
    self.assertAlmostEquals(p3.hypot, 6.136209027118437)
