Tag

dataclass

0 views collected around this technical thread.

Code Mala Tang
Code Mala Tang
Jun 11, 2025 · Fundamentals

Master Python’s @dataclass: Simplify Class Creation and Management

Learn how Python’s @dataclass decorator, introduced in Python 3.7, streamlines class definition by automatically generating constructors, string representations, and more, while covering default values, mutable defaults handling, field exclusion, read‑only classes, and conversion to tuples and dictionaries for efficient data handling.

Pythonasdictclass definition
0 likes · 8 min read
Master Python’s @dataclass: Simplify Class Creation and Management
Python Programming Learning Circle
Python Programming Learning Circle
Mar 6, 2023 · Fundamentals

A Guide to Useful Python Decorators

This article introduces several practical Python decorators—including @lru_cache, @jit, @do_twice, @count_calls, @dataclass, @singleton, @use_unit, and @singledispatch—explaining their purposes, benefits, and providing code examples to demonstrate how they can improve performance, readability, and functionality in Python programs.

Pythondataclasslru-cache
0 likes · 9 min read
A Guide to Useful Python Decorators
Python Programming Learning Circle
Python Programming Learning Circle
Aug 16, 2022 · Fundamentals

Exploring Useful Python Decorators: @lru_cache, @jit, @do_twice, @count_calls, @dataclass, @singleton, @use_unit, @singledispatch

This article introduces Python decorators, explains how they can modify function behavior, and provides practical examples of eight useful decorators—including @lru_cache, @jit, @do_twice, @count_calls, @dataclass, @singleton, @use_unit, and @singledispatch—along with code snippets that demonstrate their implementation and benefits.

Code ExamplesDecoratorsJIT
0 likes · 10 min read
Exploring Useful Python Decorators: @lru_cache, @jit, @do_twice, @count_calls, @dataclass, @singleton, @use_unit, @singledispatch