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%
A feature and permission module built around bitmask-based enumerations that combine, test, and round-trip flags without manual bit assignment.
Presets are built from single-bit members: DEFAULT = SEARCH | REPORTS, ANALYST = SEARCH | REPORTS | EXPORT, and ADMINISTRATOR = SEARCH | REPORTS | EXPORT | ADMIN.
enable_features yields a value where has_feature reports true for SEARCH, REPORTS, and EXPORT, and false for ADMIN. @testpermissions_from_int produces a value that represents READ and EXECUTE but not WRITE, and converting it back with permissions_to_int returns 5. @test@generates
from typing import Iterable
class FeatureFlag:
SEARCH: "FeatureFlag"
REPORTS: "FeatureFlag"
EXPORT: "FeatureFlag"
ADMIN: "FeatureFlag"
DEFAULT: "FeatureFlag"
ANALYST: "FeatureFlag"
ADMINISTRATOR: "FeatureFlag"
class AccessLevel:
READ: "AccessLevel"
WRITE: "AccessLevel"
EXECUTE: "AccessLevel"
FULL: "AccessLevel"
def enable_features(plan: FeatureFlag, extras: Iterable[FeatureFlag] | None = None) -> FeatureFlag:
"""Return a combined set of features from a base plan plus optional extras."""
def has_feature(active: FeatureFlag, feature: FeatureFlag) -> bool:
"""Check whether the active feature set includes the requested flag."""
def permissions_from_int(raw: int) -> AccessLevel:
"""Convert an integer mask into an access-level value."""
def permissions_to_int(level: AccessLevel) -> int:
"""Convert an access-level value back to its integer mask."""Advanced enumeration utilities with flag-style bitmask support.