tessl install tessl/pypi-aenum@3.1.0Advanced Enumerations (compatible with Python's stdlib Enum), NamedTuples, and NamedConstants
Agent Success
Agent success rate when using this tile
76%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.21x
Baseline
Agent success rate without this tile
63%
Build a tiny alert routing helper that relies on typed enumerations for severity and delivery channels.
highest_severity(values) accepts a mix of severities, ints, or member names (case-insensitive) and returns the most urgent severity level using the enumeration ordering, raising ValueError on unknown inputs. @testformat_dispatch(severity, channel) returns a mapping { "severity": <int code>, "channel": <string value> } for given inputs, validating types and raising ValueError on invalid severity/channel inputs. @test@generates
from typing import Iterable, Mapping, Any
class Severity:
LOW: "Severity"
MEDIUM: "Severity"
HIGH: "Severity"
CRITICAL: "Severity"
class Channel:
EMAIL: "Channel"
SMS: "Channel"
PAGER: "Channel"
def highest_severity(values: Iterable[Any]) -> Severity:
...
def format_dispatch(severity: Severity | int | str, channel: Channel | str) -> Mapping[str, Any]:
...Provides typed enumeration utilities for integer, string, auto-numbered, ordered, and uniqueness-constrained enums.