Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumPythondataclassesSingle-choice MCQ

Given this ordered, frozen-free dataclass with one field excluded from comparison, what does the expression evaluate to?

from dataclasses import dataclass, field @dataclass(order=True) class P: name: str = field(compare=False) age: int = 0 P("alice", 30) < P("bob", 25)