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 [develop] extras to run tests
Generating docs
make docs
You may need to install [develop] 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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
classical-2.1.1-py3-none-any.whl
(13.1 kB
view hashes)
Close
Hashes for classical-2.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 092eae632bb06e2a7c6d139c8f8491774ee69c088fa3ddce9fd97d1693c20e8c |
|
MD5 | d50d4ad8b11a31d6886cb75746750e5c |
|
BLAKE2b-256 | feb5e75b66146e23da5e283832a0114c5aae2af93a12f835281280d1e2e8afd5 |