🎙 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 9 of 10

When does postinit run?

When does __post_init__ run?

  1. A.Before init
  2. B.At the end of the generated init
  3. C.Only when the object is printed
  4. D.When the object is deleted
Answer & explanation

Correct answer: At the end of the generated init

It is the place for validation and computed fields.

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 →