Tom Ritchford
Nov 7, 2023

--

Hear, hear!

I'm at the point now that if a programmer never uses any sort of data class, like dataclasses or pydantic, I think somewhat the worse of them.

Oh, I have a tip for you, it's changed my life (a little tiny bit):

import dataclasses as dc
import typing as t

I set my editor to insert these two lines at the top of each new Python file I create (and I rely on ruff to remove them automatically if they don't actually get used.)

I picked up import typing as t from the official Python working group on typing, they use it everywhere. I thought there would be far more collisions with local variables, but it so far hasn't happened.

--

--