RosettaCodeData/Task/Polymorphism/Python/polymorphism-4.py

8 lines
166 B
Python
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
>>> Point = namedtuple('Point', 'x y')
>>> Circle = namedtuple('Circle', 'x y r')
>>> Point(3, 4)
Point(x=3, y=4)
>>> Circle(x=1, y=2, r=3)
Circle(x=1, y=2, r=3)
>>>