Slide 9
Slide 9 text
Metaprogramming Python
class
class Point
Point:
def
def __init__
__init__(self, x, y):
self.x = x
self.y = y
class
class Point3D
Point3D(Point):
def
def __init__
__init__(self, x, y, z):
super().__init__(x, y)
self.z = z
>>> p1 = Point(3, 4)
>>> p2 = Point3D(5, 6, 7)