StackOverflow Questions for Tag: python-dataclasses

Cleb
Cleb

Reputation: 26027

How to make attribute in dataclass read-only?

Score: 23

Views: 13864

Answers: 8

Read More
Oleh Rybalchenko
Oleh Rybalchenko

Reputation: 8059

Data Classes vs typing.NamedTuple primary use cases

Score: 291

Views: 118212

Answers: 8

Read More
Johz
Johz

Reputation: 200

Can I create an Enum of a dataclass instances?

Score: 10

Views: 5078

Answers: 4

Read More
Nils
Nils

Reputation: 174

Generate dataclass for typing programmatically

Score: 2

Views: 69

Answers: 1

Read More
robertspierre
robertspierre

Reputation: 4431

Define __dict__ in slotted dataclass

Score: 0

Views: 32

Answers: 1

Read More
Brian C.
Brian C.

Reputation: 7986

How can I make a python dataclass hashable?

Score: 179

Views: 100377

Answers: 4

Read More
user3414663
user3414663

Reputation: 583

How to make a Python Dataclass mixin?

Score: 0

Views: 71

Answers: 1

Read More
Maksim Burtsev
Maksim Burtsev

Reputation: 85

When is the method __post_init__ not called?

Score: 2

Views: 10409

Answers: 2

Read More
zigma12
zigma12

Reputation: 321

Process a dataclass argument with a function before its assignation as an instance attribute

Score: 2

Views: 1992

Answers: 3

Read More
Hazel
Hazel

Reputation: 183

Access container class from contained class with python dataclasses

Score: 0

Views: 41

Answers: 1

Read More
YeO
YeO

Reputation: 1170

How to apply default value to Python dataclass field when None was passed?

Score: 73

Views: 166439

Answers: 9

Read More
Lei Hao
Lei Hao

Reputation: 799

What is the difference between `cached_property` and `field(init=False)` in Python dataclass?

Score: 0

Views: 42

Answers: 2

Read More
Sharmiko
Sharmiko

Reputation: 623

Refactoring marshmellow schema to pydantic 2

Score: 0

Views: 28

Answers: 0

Read More
Dave Doty
Dave Doty

Reputation: 355

How to freeze individual field of non-frozen dataclass?

Score: 10

Views: 3217

Answers: 3

Read More
David Dahan
David Dahan

Reputation: 11172

dataclasses: how to ignore None values using asdict()?

Score: 20

Views: 22519

Answers: 6

Read More
Sai Naveen
Sai Naveen

Reputation: 39

DataClassWizard after upgrading to python3.11 is not working as expected

Score: 3

Views: 478

Answers: 1

Read More
mbatchkarov
mbatchkarov

Reputation: 16099

Python dataclass from a nested dict

Score: 204

Views: 206089

Answers: 18

Read More
Naftuli Kay
Naftuli Kay

Reputation: 91790

Recursive Types in dataclass-wizard YAML

Score: 3

Views: 512

Answers: 1

Read More
MattLovesJam
MattLovesJam

Reputation: 51

How to enforce a data schema on a numpy array

Score: 0

Views: 45

Answers: 0

Read More
Californian
Californian

Reputation: 1087

How does one ignore extra arguments passed to a dataclass?

Score: 78

Views: 58250

Answers: 7

Read More
PreviousPage 2Next