This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def lru_cache(maxsize=128, typed=False, initial_data = None): | |
"""Least-recently-used cache decorator. | |
If *maxsize* is set to None, the LRU features are disabled and the cache | |
can grow without bound. | |
If *typed* is True, arguments of different types will be cached separately. | |
For example, f(decimal.Decimal("3.0")) and f(3.0) will be treated as | |
distinct calls with distinct results. Some types such as str and int may |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r""" Commands to reproduce: | |
python -m venv test_bug_148 | |
Posix: source test_bug_148/bin.activate.sh | |
Windows: .\test_bug_148\Scripts\activate.bat | |
pip install pytest toml tomli tomli-w tomlkit toml_tools | |
pytest --tb=no -rA -q test_bug_148_fixed.py | |
Expected on Windows 10 Python 3.12: | |
.F....... [100%] | |
======================================================================== short test summary info ======================================================================== |