Advanced Enumerations (compatible with Python's stdlib Enum), NamedTuples, and NamedConstants
76
{
"context": "Evaluates how well the solution leverages aenum's NamedTuple API to model shipment records with defaults, tuple semantics, and helper methods for transforming data. Focus is on using NamedTuple-provided construction, attribute/index parity, and built-in conversion utilities rather than reimplementing tuple behavior manually.",
"type": "weighted_checklist",
"checklist": [
{
"name": "NamedTuple setup",
"description": "Defines ShipmentRecord via aenum's NamedTuple (metaclass or functional API), including the four declared fields with defaults for weight and priority so instances are tuple subclasses.",
"max_score": 25
},
{
"name": "Attribute/index parity",
"description": "Relies on NamedTuple-generated tuple ordering so field values are accessible both by attribute and by index without custom __getitem__ hacks or diverging order.",
"max_score": 20
},
{
"name": "Sequence ingestion",
"description": "Implements load_shipments using the NamedTuple constructor or _make to turn sequences into ShipmentRecord instances, applying the NamedTuple defaults for missing trailing optional fields while rejecting rows missing required id/destination.",
"max_score": 20
},
{
"name": "Mapping export",
"description": "Uses the NamedTuple _asdict helper (or equivalent NamedTuple-provided ordered mapping) in to_mapping instead of hand-building dictionaries, preserving field order and values.",
"max_score": 15
},
{
"name": "Immutable update",
"description": "Implements update_priority via the NamedTuple _replace method (or equivalent NamedTuple cloning helper) to return a new ShipmentRecord without mutating the original.",
"max_score": 20
}
]
}Install with Tessl CLI
npx tessl i tessl/pypi-aenumevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10