Comment

Comment by ericvsmith

I think you're saying that it takes fewer characters to define a namedtuple. If you're interested in less typing, There's also dataclasses.make_dataclass:

   >>> Point = dataclasses.make_dataclass("Point", ["x", "y", "z"])
   >>> Point(1, 2, 3)
   Point(x=1, y=2, z=3)
parent ericvsmith 2 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton