$npx skillfedfor your agent

cached_method

The equivalent of cached_property for methods

With conditionsPyPI Software DevelopmentReleased Oct 202177.4K downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — cached_method-0.1.0-py3-none-any.whl
v0.1.0 · released 2021-10-31 · Python >= 3.6

Yes, if you need per-instance method caching for non-hashable classes or resource-intensive objects. The code is simple and stable, but be aware the package is unmaintained since 2021-10-31—verify compatibility with your Python version before relying on it in production. For small hashable objects where global caching is acceptable, the standard functools approach may be preferable.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python >= 3.6.
  • Low install friction with no runtime dependencies.
  • However, the package is abandoned—last release was 2021-10-31 with no updates since, though the repository remains public and the code is stable.

License · maintenance · safety

permissive license (permissive) — Licensed under MIT (permissive), so you may use, modify, and distribute freely with minimal restrictions.

last release 2021-10-31 (1748 days) · last repo commit 2021-10-31 · 11 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 77,437 downloads/mo, #14,524 on PyPI

Verify before relying

from cached_method import cached_method

class Example:
    @cached_method(maxsize=2)
    def expensive_method(self, arg):
        return arg * 2

obj = Example()
result = obj.expensive_method(arg)
  • Whether the package works correctly with modern Python versions despite being unmaintained since 2021.
  • Performance characteristics compared to functools.lru_cache in typical use cases.
  • Thread-safety guarantees when methods are called concurrently with identical arguments.
Same gist for agents: .md · .json

What it is and what it does

cached_method is a decorator that caches method results on a per-instance basis, similar to functools.cached_property but for methods with arguments. Unlike functools.lru_cache applied directly to methods, it does not require the containing class to be hashable, and it does not maintain a global cache that extends object lifetimes. This is particularly useful for classes managing scarce resources like GPU memory, where you want objects and their caches to be garbage-collected together.

The decorator closely mirrors functools.cached_property's implementation but omits internal locking, accepting the possibility of redundant method calls in multi-threaded contexts when equivalent arguments are used simultaneously. It also supports caching expensive operations like __hash__ without requiring the object itself to be hashable for cache lookups.

Use it for

  • Cache expensive GPU operations in tensor-based classes where immediate garbage collection matters.
  • Memoize method results for non-hashable objects without polluting a global cache.
  • Cache __hash__ computations for objects that perform costly transfers between devices.
  • Reduce redundant computation in methods called repeatedly with the same arguments within an instance.
  • Manage memory-intensive resources that should be freed when their owning object is deleted.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need per-instance method caching for non-hashable classes or resource-intensive objects.

The code is simple and stable, but be aware the package is unmaintained since 2021-10-31—verify compatibility with your Python version before relying on it in production. For small hashable objects where global caching is acceptable, the standard functools approach may be preferable.

Install

cached-method on PyPI

Before you install

Low install friction with no runtime dependencies. However, the package is abandoned—last release was 2021-10-31 with no updates since, though the repository remains public and the code is stable.

Requires Python >= 3.6.

License in practice

Licensed under MIT (permissive), so you may use, modify, and distribute freely with minimal restrictions.

Quickstart

from cached_method import cached_method

class Example:
    @cached_method(maxsize=2)
    def expensive_method(self, arg):
        return arg * 2

obj = Example()
result = obj.expensive_method(arg)

Verify before relying

  • Whether the package works correctly with modern Python versions despite being unmaintained since 2021.
  • Performance characteristics compared to functools.lru_cache in typical use cases.
  • Thread-safety guarantees when methods are called concurrently with identical arguments.

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >= 3.6
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceAbandoned 1,748 days since the last release
Last repo commit
First released
Downloads77,437 / month, #14,524 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python

Evidence: cached_method-0.1.0-py3-none-any.whl

Tags

Capabilities
method result cachingper-instance cache decoratorcached_property for methodsinstance-level memoizationavoid lru_cache on methods
Topics
cachingmemoizationresource-management

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 › “per-instance cache decorator”

  • cached_methodProvides a method-level caching decorator that stores results per…
  • django-cache-memoizeA decorator that caches function results using Django's cache…
  • cachettlcachettl provides LRU TTL cache decorators for both synchronous and…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

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.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

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.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

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.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

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.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

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.

permissive licensepure Python
323.3Mdownloads / mo

See also propcache · methodtools · memoization · backports.cached-property · django-memoize · cachier · django-cache-memoize · cache-to-disk · klepto · weakrefmethod