Ctrl + k

or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/frozendict@2.4.x
tile.json

tessl/pypi-frozendict

tessl install tessl/pypi-frozendict@2.4.0

A simple immutable dictionary implementation with hashing support and performance optimizations

Agent Success

Agent success rate when using this tile

85%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.31x

Baseline

Agent success rate without this tile

65%

task.mdevals/scenario-1/

Cross-Version Configuration Manager

A configuration management system that works across Python 3.6+ using frozendict for immutable configuration storage.

Capabilities

Version-aware Configuration Loading

Load configuration from a dictionary and store it as an immutable frozendict that works across Python 3.6+.

  • Loading a configuration dictionary {"host": "localhost", "port": 8080} creates an immutable frozendict config @test
  • The loaded configuration is hashable and can be used as a dictionary key @test

Configuration Iteration

Iterate over configuration keys in both forward and reverse order, with proper fallback for older Python versions.

  • Iterating forward over config with keys ["host", "port", "timeout"] yields keys in insertion order @test
  • Iterating in reverse over config with keys ["host", "port", "timeout"] yields ["timeout", "port", "host"] @test

Configuration Validation

Verify that configurations are properly immutable and handle type checking gracefully across Python versions.

  • Attempting to modify a configuration raises TypeError @test
  • Configuration supports isinstance checks with Mapping from collections.abc @test

Implementation

@generates

API

from frozendict import frozendict
from typing import Dict, Any, Iterator

def load_config(config_dict: Dict[str, Any]) -> frozendict:
    """
    Load a configuration dictionary into an immutable frozendict.

    Args:
        config_dict: A dictionary containing configuration key-value pairs

    Returns:
        An immutable frozendict containing the configuration
    """
    pass

def iterate_config(config: frozendict) -> Iterator[str]:
    """
    Iterate over configuration keys in forward order.

    Args:
        config: A frozendict configuration object

    Yields:
        Configuration keys in insertion order
    """
    pass

def reverse_iterate_config(config: frozendict) -> Iterator[str]:
    """
    Iterate over configuration keys in reverse order.
    Falls back to list reversal on Python < 3.8.

    Args:
        config: A frozendict configuration object

    Yields:
        Configuration keys in reverse insertion order
    """
    pass

def is_immutable_mapping(config: frozendict) -> bool:
    """
    Check if config is an immutable Mapping using collections.abc.

    Args:
        config: A frozendict configuration object

    Returns:
        True if config is a Mapping instance
    """
    pass

Dependencies { .dependencies }

frozendict { .dependency }

Provides immutable dictionary implementation with cross-version Python support.

@satisfied-by