← Quiz: Type Hints and Dataclasses: all 10 questions
Quiz: Type Hints and Dataclasses · Question 4 of 10
Which methods does a plain @dataclass generate?
Which methods does a plain @dataclass generate?
- A.Only init
- B.init, hash and lt
- C.init, repr and eq
- D.str and len
Answer & explanation
Correct answer: init, repr and eq
Ordering and hashing need extra options such as order=True or frozen=True.
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 →