lazr.delegates
Easily write objects that delegate behavior
What it is and what it does
lazr.delegates is a utility for the object composition pattern, letting you create wrapper objects that forward calls to an underlying object while maintaining interface contracts through zope.interface. It reduces boilerplate when you need to add behavior to an existing object without modifying it directly—common in plugin systems, decorators, and layered architectures.
The package works by helping you declare which object to delegate to and automatically handling method/property forwarding. It relies on zope.interface to ensure the wrapper still satisfies the original interface contract. With a single runtime dependency and support for Python 3.8 through 3.14, it integrates cleanly into projects already using the Zope ecosystem or those adopting interface-based design.
Use it for:
- Add logging or caching behavior to an existing object without modifying its class
- Build plugin systems where decorators wrap core objects with additional functionality
- Implement proxy or adapter patterns while maintaining type safety through interfaces
- Create layered architectures where each layer wraps and extends the layer below
- Compose behavior from multiple objects while presenting a unified interface to callers
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Simplifies creating wrapper objects that delegate method and property calls to an underlying object while adding or modifying behavior through zope.interface.
Yes, if you are already using zope.interface or building systems that rely on interface-based design and composition. The package is stable, actively maintained, has no known vulnerabilities, and installs with minimal friction. It is most valuable in projects that benefit from explicit delegation and interface contracts; for simple wrapping without interface requirements, standard Python patterns may suffice.
Install
lazr-delegates on PyPI
pip
pip install lazr-delegatesuv
uv add lazr-delegatespoetry
poetry add lazr-delegatesInstalling lazr.delegates
Before you install
Low friction installation with a single pure-Python dependency (zope.interface). Package is actively maintained with a recent release and supports current Python versions from 3.8 through 3.14.
License in practice
Licensed under LGPL v3 (copyleft). Any modifications to this package must be released under the same license, and derivative works must provide source code access to users.
Quickstart
pip install lazr-delegates
from lazr.delegates import delegates
from zope.interface import Interface, implementer
class IBase(Interface):
pass
@implementer(IBase)
class Base:
def method(self):
return 'base'
@implementer(IBase)
@delegates('_base')
class Wrapper:
def __init__(self, base):
self._base = base
Verify before relying
- Whether the package provides decorators or explicit delegation configuration beyond what the description states
- Performance characteristics when delegating across many methods or in high-call-volume scenarios
- Interaction patterns with zope.interface's advanced features (adapters, utilities, etc.)
Package facts
| License | LGPL v3 (copyleft) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — zope.interface |
| Maintenance | actively maintained — 13 days since the last release |
| First released | |
| Downloads | 661,121/month — #5,453 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: lazr_delegates-4.0.0-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
lazr.restfulclientA programmable HTTP client library for…
copyleft · top 15,000 on PyPI
lazr.uriParse, manipulate, and generate URIs with a…
copyleft · top 15,000 on PyPI
lazr.configlazr.config lets you define configuration…
copyleft · top 15,000 on PyPI
subagents-pydantic-aiAdds multi-agent delegation to Pydantic AI…
permissive · top 15,000 on PyPI
wireropeWraps Python callables (functions and methods)…
permissive · top 5,000 on PyPI
zope.proxyzope.proxy provides transparent wrapper objects…
unclear · top 15,000 on PyPI
xlocalProvides execution-local storage that scopes…
unclear · top 15,000 on PyPI
iterproxyWraps any iterable object to provide ORM-style…
permissive · top 5,000 on PyPI
langgraph-supervisorBuilds hierarchical multi-agent systems where a…
permissive · top 15,000 on PyPI
zope.annotationStores additional metadata on objects without…
unclear · top 15,000 on PyPI