--- id: lazr-delegates version: "4.0.0" license: LGPL v3 license_treatment: copyleft maintenance: active --- # lazr.delegates — Easily write objects that delegate behavior License: copyleft · Maintenance: active · Downloads: 661.1K/mo ## 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 above — 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 pip install lazr-delegates uv add lazr-delegates poetry add lazr-delegates ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 661.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags object delegation pattern, wrapper object behavior, interface delegation, delegate methods to another object, add behavior to existing objects, proxy pattern implementation, object composition helper, object-composition, design-patterns, zope-ecosystem [View on SkillFed](https://skillfed.io/packages/lazr-delegates) · [View on PyPI](https://pypi.org/project/lazr-delegates/)