An example package. Replace this with a proper project description. Generated with https://github.com/ionelmc/cookiecutter-pylibrary
Project description
Container class boilerplate killer.
Features:
Human-readable __repr__
Complete set of comparison methods
Keyword and positional argument support. Works like a normal class - you can override just about anything in the subclass (eg: a custom __init__). In contrast, hynek/characteristic forces different call schematics and calls your __init__ with different arguments.
Installation
pip install fields
Usage
>>> from fields import Fields >>> >>> class Pair(Fields.a.b): ... pass ... >>> p = Pair(1, 2) >>> p.a 1 >>> p.b 2 >>> class Node(Fields.value.left(None).right(None)): ... pass ... >>> p = Node(1, left=Node(2), right=Node(3, left=Node(4))) >>> p <Node(left=<Node(left=None, right=None, value=2)>, right=<Node(left=<Node(left=None, right=None, value=4)>, right=None, value=3)>, value=1)>
Documentation
Development
To run the all tests run:
tox
Changelog
0.1.0 (2014-06-08)
First release on PyPI.
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
fields-0.1.0.tar.gz
(12.5 kB
view hashes)
Built Distribution
Close
Hashes for fields-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 914e02eef2badf017bc058c769ffdbb708dbf5ed0f91bcf0c3bd08f3f19e861e |
|
MD5 | 44801211e03f262a5c53d8e1487f47f6 |
|
BLAKE2b-256 | bbe878c2013d8cb36508dd0876fec3aa80221309bbc7b54d297905c51f5b4510 |