#DataClasses
新しく記事を投稿しました!
PythonのDataClasses入門:簡潔で強力なクラス設計の活用例4選
https://boochi-engineer.net/?p=786
March 2, 2025 at 2:43 AM
need an agent skill that’s just like USE PYDANTIC NEVER USE DATACLASSES IF YOU CAN HELP IT MAKE NO MISTAKES
June 28, 2026 at 1:30 AM
My codebase so far is basically: dataclasses and functions that transform/insert/update them in the DB. Raw SQL and some database query helpers. Turns out LLMs love that. What's great for humans is also great for agents.
May 28, 2025 at 6:26 PM
dataclasses 🤤
July 4, 2024 at 11:04 PM
Easily add ordering to #Python dataclasses 💡

Dataclasses aren't orderable by default. Add `order=True` to auto-generate comparison methods like __lt__ & __gt__.

This makes sorting/compare tasks seamless! Check out an example 👇

How do you use dataclasses in your projects? 🚀
January 28, 2025 at 3:25 PM
Python Tip #241 (of 365):

Let dataclasses write your dunder methods. 🧵

The dataclass decorator writes __init__, __repr__, and __eq__ for you:

from dataclasses import dataclass

@dataclass
class Comment:
text: str
line: int

#Python #DailyPythonTip
August 29, 2026 at 6:04 PM
🐍📩 Pycoders Weekly (Issue 663) — DRF, Temp Files, Dataclasses, and More

https://buff.ly/4h8MTrr
January 8, 2025 at 10:21 PM
Python Dataclasses
May 12, 2026 at 1:20 AM
Python's dataclass decorator offers structured, readable config models to replace messy dictionaries. Follow these tips for maintainable code: compose nested records, enforce invariants, and serialize smartly. #Python #DataClasses #Configurations
Dataclasses for Structured Application Data - MachineLearningMastery.com
In this article, you will learn how Python’s dataclass decorator can replace fragile configuration dictionaries with structured, readable, and maintainable data models.
machinelearningmastery.com
September 25, 2026 at 4:39 AM
I'm writing Python code for a simple thing like a 2D point. Should I use dataclasses or named tuples?
January 4, 2025 at 12:54 AM
A great writeup - how to use new-ish Python features for cleaner and more robust versions of code I'm sure we've all written many times - dataclasses and typing in a very common use case.
April 18, 2025 at 12:14 AM
from typing import Any
from dataclasses import dataclass

@ dataclass
class Person:
gender:Any = None
April 20, 2025 at 7:31 PM
Pydantic is awesome for data cleaning + validation, but if you want something quick + stdlib only, you can also use dataclasses + `__post_init__` 🐍 😍 - see example below. 🚀

#python #tips
April 11, 2025 at 9:40 AM
The Inner Workings of Python Dataclasses Explained #python
The Inner Workings of Python Dataclasses Explained #python
Discover how Python dataclasses work internally! Learn how to use `__annotations__` and `exec()` to make our own dataclass decorator!
jacobpadilla.com
February 10, 2025 at 4:00 AM
- Type-level invariants at every level—in Python, dataclasses and protocols.
- Clean, decomposable interfaces that cut the system at its joints
- Documentation for each module, explaining what it contains and where
- Documentation of decisions made, and decisions *not* made and why. /.
April 2, 2026 at 6:41 PM
If you are writing a project in Python of even medium complexity, for the love of God, please use dataclasses instead of just shoving everything into a dictionary.
February 11, 2025 at 9:46 PM
+10000, some other recs based on academic code I've seen:

1. use type annotations by default. Will make it MUCH easier to debug later on.
2. variable names: t_transpose bad, explain what it means
3. PyTorch shape suffixes: good idea medium.com/@NoamShazeer...
4. enums good, dataclasses great
Shape Suffixes — Good Coding Style
If you code neural networks, I believe that this convention can make your life more pleasant. We keep this pretty religiously at…
medium.com
December 18, 2024 at 8:53 PM
“The Inner Workings of Python Dataclasses Explained” jacobpadilla.com/articles/pyt... #python #programming
The Inner Workings of Python Dataclasses Explained
Discover how Python dataclasses work internally! Learn how to use __annotations__ and exec() to make our own dataclass decorator!
jacobpadilla.com
December 24, 2024 at 6:53 PM
Am I really the only one using dataclasses for _everything_ in Python now? I mean, who needs to write a __init__ anymore, so boring...
April 30, 2025 at 7:26 PM
Dataclasses aren't the right fit for every class.

Customizing dataclass fields & initialization sometimes takes a bit of work and inheriting from a dataclasses can be a BIT odd...
August 29, 2026 at 6:04 PM
Dataclasses, editable installs, virtual environments, and a free-threaded build enable faster Python development, isolated dependencies, and improved parallelism.
Save What Matters
Curate Feeds | Make Collections | Customize Email Briefs
briefly.co
September 18, 2026 at 9:23 AM
September 18, 2026 at 7:19 PM
if we can't solve it in Object bc of the underlying js feels like we should be able to solve it with something like a better struct (python dataclasses?)
September 20, 2024 at 10:45 PM
Python Tip #149 (of 365):

Sort by specific attributes with operator.attrgetter 🧵

Have an iterable of dataclasses, namedtuples, or some other record-like object?

Want to sort them by a specific attribute?

Use operator.attrgetter:

from operator import attrgetter

#Python #DailyPythonTip
May 29, 2026 at 6:05 PM
This reminds me — are there any good collective resources of like “wanna do research fast? this neat trick will save you x time”

Im always convincing folks to use torch/jax typing & dataclasses — because I do not have the mental bandwidth to remember what is in any given container variable.
Unit tests in research code feel like something that's slowing you down until they wind up saving you six months of suffering
December 1, 2025 at 4:15 PM