🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Makes it faster to create
  2. B.Makes its fields read-only and the objects hashable
  3. C.Stops it from being printed
  4. 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 →