Polymorphism: Difference between revisions

Mutable defalt value is evil! all default circles would share same center point. Mutating one circle center will move all.
(Mutable defalt value is evil! all default circles would share same center point. Mutating one circle center will move all.)
Line 737:
 
class Circle(object):
def __init__(self, center=Point()None, radius=1.0):
self.center = center or Point()
self.radius = radius
def __repr__(self):
Anonymous user