tessl install tessl/pypi-frozendict@2.4.0A 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%
You need to build a simple configuration update system that maintains immutability while allowing functional-style updates. The system should track application settings that cannot be modified in place, but can be transformed into new versions with updated values.
Implement a configuration manager that:
Your configuration should be stored in an immutable dictionary that cannot be modified after creation. You must use an appropriate immutable data structure for this purpose.
Implement the following operations, each returning a new immutable configuration:
All operations must follow a functional programming approach:
Provides immutable dictionary support.
File: test_config.py @test-file
Create an initial configuration with {"debug": False, "timeout": 30}.
Update the configuration to set timeout to 60. Verify:
timeout equal to 60debug equal to Falsetimeout equal to 30File: test_config.py @test-file
Create an initial configuration with {"debug": False}.
Add a new setting max_retries with value 3. Verify:
debug and max_retries keysdebug keyFile: test_config.py @test-file
Create a configuration with {"debug": True, "timeout": 30, "host": "localhost"}.
Remove the timeout setting. Verify:
debug and host but not timeoutport raises a KeyErrorFile: test_config.py @test-file
Create a configuration with {"debug": False}.
Ensure a default value for timeout with default 30. Verify:
debug and timeout keystimeout equals 30Apply ensure default for debug with default True. Verify:
debug still equals False (original value preserved)