backports.functools-lru-cache
Backport of functools.lru_cache
Decision gist · record as of 2026-08-14
Yes, if you need function caching and must support Python versions before 3.2, or if you want a single import pattern across multiple Python versions. However, verify whether your actual minimum Python version truly requires this backport—Python 3.8+ already includes functools.lru_cache natively, making this package redundant for most modern codebases.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8 or later.
- Low install friction with a single pure-Python wheel dependency.
- Actively maintained as of 2026-04-13 with stable production status.
License · maintenance · safety
permissive license (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects.
last release 2023-12-13 (975 days) · last repo commit 2026-04-13 · 37 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,705,926 downloads/mo, #3,635 on PyPI
Alternatives
Verify before relying
pip install backports.functools-lru-cache
try:
from functools import lru_cache
except ImportError:
from backports.functools_lru_cache import lru_cache- Whether this backport is still necessary given the stated Python 3.8+ requirement, since functools.lru_cache has been available since Python 3.2.
- Specific use cases where the standard library version is unavailable despite meeting the Python 3.8+ minimum.
What it is and what it does
This package backports the lru_cache decorator from Python 3.3's functools module, allowing developers to use function result caching via a simple decorator on Python versions that lack it. The decorator caches function results based on input arguments, avoiding redundant computation for repeated calls with the same parameters.
The package is designed for compatibility scenarios where code must run on Python versions predating lru_cache's introduction. It follows the standard import-fallback pattern: code attempts to import from the standard library first, then falls back to this backport if unavailable. With zero runtime dependencies and a permissive MIT license, it introduces minimal overhead to any project that includes it.
Use it for
- Caching expensive computations (database queries, API calls, mathematical calculations) in long-running applications.
- Providing function result caching in libraries that must support multiple Python versions via a single import.
- Optimizing recursive algorithms by caching intermediate results to reduce redundant computation.
- Reducing redundant I/O operations in utilities that repeatedly call the same function with overlapping parameters.
- Ensuring consistent behavior across codebases that target both older and modern Python versions.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need function caching and must support Python versions before 3.2, or if you want a single import pattern across multiple Python versions.
However, verify whether your actual minimum Python version truly requires this backport—Python 3.8+ already includes functools.lru_cache natively, making this package redundant for most modern codebases.
Install
backports-functools-lru-cache on PyPI
Before you install
Low install friction with a single pure-Python wheel dependency. Actively maintained as of 2026-04-13 with stable production status.
Requires Python 3.8 or later.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects.
Quickstart
pip install backports.functools-lru-cache
try:
from functools import lru_cache
except ImportError:
from backports.functools_lru_cache import lru_cache
Verify before relying
- Whether this backport is still necessary given the stated Python 3.8+ requirement, since functools.lru_cache has been available since Python 3.2.
- Specific use cases where the standard library version is unavailable despite meeting the Python 3.8+ minimum.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 975 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,705,926 / month, #3,635 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3 |
Evidence: backports.functools_lru_cache-2.0.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “python 3.3 functools”
- backports.functools-lru-cacheProvides the lru_cache decorator from Python 3.3's functools module…
- functools32Backport of Python 3.2's functools module (including lru_cache…
- jaraco.functoolsProvides additional functional programming utilities beyond Python's…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also functools32 · methodtools · pytest-antilru · async-lru · pylru · memoization · repoze-lru · cachetools · backports.cached-property · lru-dict