https://github.com/zopefoundation/extensionclass
Metaclass for subclassable extension types
https://github.com/zopefoundation/extensionclass
Last synced: 8 months ago
JSON representation
Metaclass for subclassable extension types
- Host: GitHub
- URL: https://github.com/zopefoundation/extensionclass
- Owner: zopefoundation
- License: other
- Created: 2013-02-25T15:27:27.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2025-03-04T22:13:27.000Z (over 1 year ago)
- Last Synced: 2025-10-08T12:10:43.954Z (8 months ago)
- Language: Python
- Homepage:
- Size: 415 KB
- Stars: 4
- Watchers: 61
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
====================================================
ExtensionClass and ExtensionClass-related packages
====================================================
ExtensionClass
==============
This package provides a metaclass that allows classes implemented in
extension modules to be subclassed in Python. Unless you need
ExtensionClasses for legacy applications (e.g. Zope), you probably
want to use Python's new-style classes (available since Python 2.2).
ComputedAttribute
=================
This package provides a way to attach attributes to an
``ExtensionClass`` or instance that are computed by calling a
callable. This works very much like ``property`` known from new-style
classes, except that a ``ComputedAttribute`` can also be attached to
an instance and that it honours ExtensionClass semantics (which is
useful for retaining Acquisition wrappers, for example).
MethodObject
============
This package lets you attach additional "methods" to ExtensionClasses.
These "methods" are actually implemented by subclassing the
``MethodObject.Method`` class and implementing the ``__call__`` method
there. Instances of those classes will be bound to the instances
they're attached to and will receive that instance object as a first
parameter (after ``self``).