Class Tools for Python
Project description
Convenience tools for working with Python classes.
Simplified subclassing:
class MyClass:
def __init__(self, *args, **kwargs):
pass # do whatever
# subclass with presets
MySubClass = argumented_subclass(MyClass, 'MySubClass', arg1='value', arg2=4)
Various descriptors:
class Thing:
Red = ArgumentedSubclass(color='red')
book = AutoProperty(has='pages')
def __init__(self, color=None, has=None):
self.color = color
self.has = has
Thing.Red # is a subclass of Thing and is 'red'
Thing.Red.book # is an instance of Thing (and Thing.Red), is 'red' and has 'pages'
See the full documentation at http://classical.readthedocs.io/en/latest/
Installation
pip install classical
Testing
make test
You may need to install [fielded,testing] extras to run tests
Generating docs
make docs
You may need to install [fielded,docs] extras to generate docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
classical-2.1.2.tar.gz
(10.9 kB
view hashes)
Built Distribution
classical-2.1.2-py3-none-any.whl
(13.1 kB
view hashes)
Close
Hashes for classical-2.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09f9f1aea8dc6f7a2d958cab5885d15562cfa067710363a15c960800e58e30c9 |
|
MD5 | 3406bf61b9fc93f5ce050cec5d96f43c |
|
BLAKE2b-256 | 670f079b28b6ab43e297791b432dd46b5f1e38a22ba9c4df231f3f69597de0c9 |