Anonymous user
Polymorphism: Difference between revisions
Mutable defalt value is evil! all default circles would share same center point. Mutating one circle center will move all.
m (→[[Python]]) |
(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=
self.center = center or Point()
self.radius = radius
def __repr__(self):
|