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-7/

Configuration State Manager

A utility that manages application configuration states across different runtime contexts, ensuring configurations can be safely serialized, transmitted, and restored.

Overview

Build a configuration state manager that can persist immutable configuration snapshots using serialization, and create independent copies of configuration data for different application contexts. The system must handle various serialization scenarios including protocol compatibility and nested data structures.

Capabilities

Serialization to bytes

  • Given a configuration dictionary, serialize it to bytes and verify it can be deserialized back to an equivalent structure @test

Protocol compatibility

  • Given a configuration, serialize it using different pickle protocols and verify all produce valid serialized data that can be deserialized @test

Shallow copy behavior

  • Given a configuration, create a shallow copy and verify the copy references the same underlying object when appropriate @test

Deep copy with nested structures

  • Given a configuration containing nested unhashable values (like lists), create a deep copy and verify it produces a truly independent copy @test

Implementation

@generates

The implementation should:

  • Accept configuration data as dictionaries
  • Provide methods to serialize configurations to bytes
  • Provide methods to deserialize configurations from bytes
  • Support creating shallow and deep copies of configurations
  • Handle nested data structures appropriately

API

def create_config(data: dict):
    """
    Creates an immutable configuration from a dictionary.

    Args:
        data: Dictionary containing configuration key-value pairs

    Returns:
        An immutable configuration object
    """
    pass

def serialize_config(config, protocol=None):
    """
    Serializes a configuration to bytes using pickle.

    Args:
        config: The configuration object to serialize
        protocol: Optional pickle protocol version to use

    Returns:
        bytes: Serialized configuration data
    """
    pass

def deserialize_config(data: bytes):
    """
    Deserializes a configuration from bytes.

    Args:
        data: Serialized configuration bytes

    Returns:
        Deserialized configuration object
    """
    pass

def shallow_copy_config(config):
    """
    Creates a shallow copy of a configuration.

    Args:
        config: The configuration to copy

    Returns:
        A shallow copy of the configuration
    """
    pass

def deep_copy_config(config):
    """
    Creates a deep copy of a configuration.

    Args:
        config: The configuration to copy

    Returns:
        A deep copy of the configuration
    """
    pass

Dependencies { .dependencies }

frozendict { .dependency }

Provides immutable dictionary support with serialization capabilities.