Skip to content

Instantly share code, notes, and snippets.

@mu-777
Last active October 26, 2015 09:09
Show Gist options
  • Save mu-777/5b4064c4e18feba6e7a8 to your computer and use it in GitHub Desktop.
Save mu-777/5b4064c4e18feba6e7a8 to your computer and use it in GitHub Desktop.
from collections import namedtuple
Point = namedtuple('Point3d', 'x y z')
point = Point(10,20,30)
>>> point
Point3d(x=10, y=20, z=30)
>>> print point.x, point.y, point.z
10 20 30
>>> print point[0], point[1], point[2]
10 20 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment