Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

my_point3d = (1.0, 2.5, 7.2)

Voila!



This is explicitly called out in the article.

What does your code do when I try my_point3d.x ?


you can do that with namedtuples too; the problem is that tuples are immutable, so you cannot say e.g. `my_point3d.x = 10`




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: