Advanced Enumerations (compatible with Python's stdlib Enum), NamedTuples, and NamedConstants
76
{
"context": "Evaluates whether the solution uses aenum's NamedConstant/Constant to build immutable payment status constants with built-in name/value metadata, by-value lookups, and ordered iteration. Checks focus on leveraging aenum primitives instead of hand-rolled dictionaries or ad hoc immutability guards.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses NamedConstant",
"description": "PaymentStatus is declared as a subclass of aenum.NamedConstant or aenum.Constant, not a plain class or Enum, ensuring the library's constant behaviors are active.",
"max_score": 25
},
{
"name": "Built-in lookup",
"description": "status_from_code delegates to aenum's by-value resolution (e.g., PaymentStatus(code) or accessing value-to-member maps) rather than maintaining a separate manual dictionary, and raises ValueError for unknown codes.",
"max_score": 25
},
{
"name": "Immutability guard",
"description": "Relies on NamedConstant/Constant's prevention of attribute rebinding or deletion (AttributeError on set/del) instead of custom setter overrides or defensive copies.",
"max_score": 20
},
{
"name": "Name/value usage",
"description": "Retrieves status metadata via the NamedConstant member interfaces (name/value attributes) rather than duplicating labels or codes in parallel structures.",
"max_score": 15
},
{
"name": "Library iteration",
"description": "list_status_codes derives ordering from NamedConstant's member iteration (e.g., list(PaymentStatus) or PaymentStatus.__members__.items()) instead of hardcoded lists.",
"max_score": 15
}
]
}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