7

I'm still digesting this one and haven't formed any strong opinions yet.

I've had problems in the past where this could have been useful, like ingesting millions of lat/long positions and trying to string them together in a "trail". But, I was still able to handle that fine with namedtuple without too much pain.

Thoughts?

you are viewing a single comment's thread
view the rest of the comments
[-] erez@lemmy.world 3 points 1 year ago* (last edited 1 year ago)

I agree with the article that dataclasses and namedtuples aren't as good as they can be. But I think the solution should be to make dataclasses native, and not namedtuples.

So we could write something like:

dataclass Point:
  x: int   @"why not also add new syntax for documentation?"
  y: int   @"the size of translation on the Y axis"

  def methods_as_usual(self):
      ...

this post was submitted on 14 Jun 2023
7 points (100.0% liked)

Python

6356 readers
5 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS