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%
Design an enumeration that models application access scopes while carefully controlling which attributes become members and which stay as helpers.
registry (code-to-label map built from real scopes) and _cache stay accessible but never appear in __members__ or iteration. @test.value equals the number of real scopes (3), derived from the current members rather than hard-coded. @testAUDIT_PREFIX returns the string "access:"; attempts to reassign or delete it raise AttributeError; it is not counted as an enum member. @testlabel giving "Admin", "Editor", "Viewer"; it coexists with the stored raw code without shadowing iteration or member lookup. @test@generates
from typing import Dict
class AccessScope(Enum):
AUDIT_PREFIX: str
registry: Dict[str, str]
ADMIN: "AccessScope"
EDITOR: "AccessScope"
VIEWER: "AccessScope"
TOTAL_COUNT: "AccessScope"
def __init__(self, code: str, label: str): ...
@property
def code(self) -> str: ...
@property
def label(self) -> str: ...
def is_elevated(self) -> bool: ...
def describe(self) -> str: ...Provides descriptor-based helpers for controlling enum membership, constants, and properties.