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

I gives a name and expected properties to common data structures, or unspoken unnamed types.

Many times when a dict is used, it's expected to have certain attributes, and may have expected ways of interacting with those attributes. Named tuples is a simple way to formalize these, which makes them not so mysterious to you future-you, or to other developers who inherit the project 6 months down the road.



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

Search: