/protoclass

Prototype-Oriented Programming in Python at the tip of your fingers in a simple, easy-to-use library.

Primary LanguagePythonApache License 2.0Apache-2.0

protoclass - Prototype-Oriented Programming in Python.

Prototype-Oriented Programming in Python at the tip of your fingers in a simple, easy-to-use library.

PyPI-package-version PyPI-license PyPI-python-versions travis-ci readthedocs PyPI-downloads-month

Installation

pip install protoclass

Usage

API Reference

proto(**attrs)
Makes a new prototype with given attributes. An empty prototype will be made when no attributes are given.
proto.chain(self, other, *others)
Makes self copy attributes from another prototype or multiple other prototypes. Any previous relationship with other parent prototypes will be automatically severed. When parent prototypes share attributes with the same name, the first parent prototype that has that attribute will be provide it, so the order in which they are given matters. Any change made to parent prototypes will be automatically propagated to this prototype.
clone(other, *others)
Makes a new prototype by copying attributes from another prototype or multiple other prototypes. When parent prototypes share attributes with the same name, the first parent prototype that has that attribute will be provide it, so the order in which they are given matters. Any change made to parent prototypes will be automatically propagated to this clone.

For more information on these functions, call help on the function you would like to know more of, like this: help(proto). You can also read the docs.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.