weakrefmethod
A WeakMethod class for storing bound methods using weak references.
Decision gist · record as of 2026-08-14
No, unless you are actively maintaining Python 2.6 or 2.7 code. The package is unmaintained (last release 2016-07-18), and modern Python versions include WeakMethod in the standard library. For any new or current projects, use the built-in weakref.WeakMethod instead.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Package targets Python 2.6 and 2.7, which are no longer supported.
- WeakMethod is available in the standard library for Python 3.4 and later.
- High install friction due to source distribution only.
License · maintenance · safety
PSF (permissive) — Licensed under the Python Software Foundation License (permissive). No restrictions on use, modification, or distribution in your own code.
last release 2016-07-18 (3679 days) · last repo commit 2025-03-25 · 3 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 73,952 downloads/mo, #14,899 on PyPI
Alternatives
Verify before relying
pip install weakrefmethod
from weakrefmethod import WeakMethod
class MyClass:
def method(self):
pass
obj = MyClass()
weak_method = WeakMethod(obj.method)- Whether this package actually works on modern Python versions despite targeting only Python 2.6–2.7
- Whether any real-world projects still depend on this backport or if it is purely historical
- Current status of Python 2 support in production environments
What it is and what it does
WeakMethod is a utility for storing references to bound methods without preventing their parent object from being garbage collected. This package backports Python 3.4's standard library WeakMethod class to Python 2.6 and 2.7, allowing developers on those older versions to use weak method references in their code.
The package has no runtime dependencies and is a pure-Python implementation. However, it targets Python versions that are no longer actively maintained. Installing this package makes sense only if you are maintaining legacy Python 2 code that specifically needs weak method storage.
Use it for
- Prevent memory leaks in Python 2 code by storing weak references to bound methods instead of strong references
- Implement observer patterns or event handlers in Python 2 that don't keep objects alive
- Maintain legacy Python 2.6 or 2.7 projects that require weak method references without reimplementing the logic
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No, unless you are actively maintaining Python 2.6 or 2.7 code.
The package is unmaintained (last release 2016-07-18), and modern Python versions include WeakMethod in the standard library. For any new or current projects, use the built-in weakref.WeakMethod instead.
Install
weakrefmethod on PyPI
Before you install
High install friction due to source distribution only. The package is aging—last release in 2016, no updates since then—and targets Python 2.6 and 2.7, which are long out of support.
Package targets Python 2.6 and 2.7, which are no longer supported. WeakMethod is available in the standard library for Python 3.4 and later.
License in practice
Licensed under the Python Software Foundation License (permissive). No restrictions on use, modification, or distribution in your own code.
Quickstart
pip install weakrefmethod
from weakrefmethod import WeakMethod
class MyClass:
def method(self):
pass
obj = MyClass()
weak_method = WeakMethod(obj.method)
Verify before relying
- Whether this package actually works on modern Python versions despite targeting only Python 2.6–2.7
- Whether any real-world projects still depend on this backport or if it is purely historical
- Current status of Python 2 support in production environments
Package facts
| License | PSF permissive |
| Python support | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Aging 3,679 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 73,952 / month, #14,899 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: Python Software Foundation LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Topic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules |
Evidence: weakrefmethod-1.0.3.tar.gz
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 › “weak references bound methods”
- weakrefmethodProvides a WeakMethod class for storing bound methods using weak…
- backports.weakrefBackports the `weakref.finalize` class from Python 3.4+ to earlier…
- methodtoolsProvides LRU caching for methods, classmethods, and staticmethods…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also backports.weakref · backports.tempfile · linecache2 · objsize · cached_method · backrefs · HTMLParser · traceback2 · backports.zstd · jsonref