← Quiz: Type Hints and Dataclasses: all 10 questions
Quiz: Type Hints and Dataclasses · Question 8 of 10
What does frozen=True do to a dataclass?
What does frozen=True do to a dataclass?
- A.Makes it faster to create
- B.Makes its fields read-only and the objects hashable
- C.Stops it from being printed
- D.Converts it to a tuple
Answer & explanation
Correct answer: Makes its fields read-only and the objects hashable
Assigning to a field raises FrozenInstanceError.
Can you get the rest right without peeking?
Take the timed Quiz: Type Hints and Dataclasses quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →