parallel object manipulation
Project description
Collateral
This tool package provides a simple way to manipulate collateral objects in parallel.
Basically, it provides Collateral
objects, which gather several objects, called collaterals.
The object has two kinds of methods/attributes: collateral and transversal.
Collateral methods and attributes
A collateral method returns a Collateral
object (or None
),
which is formed by the result of calling the corresponding method
on each of the collaterals.
Similarly, a collateral attribute has as value,
the Collateral
object (or None
)
formed by the result of getting the corresponding attribute
from each of the collaterals.
Hence, a collateral method/attribute behaves on each of the collaterals independently.
Collateral methods/attributes exist in a Collateral
object
if and only if they exist in at least one of its collaterals.
Transversal methods and attributes
Every Collateral
object has the same, few, transversal methods and attributes,
which aim to provide basic manipulation method and information on the Collateral
object itself,
that is, not only on its collaterals.
These methods are methods/attributes of the object
that manipulate the whole object.
They typically do not manipulate the collaterals idenpendently.
E.g., the attribute collaterals
is a property returning the tuple of collaterals.
Examples:
import collateral as ll
pL = ll.Collateral([3, 4], [5, 2])
pL[0]
#returns a Collateral object with two collaterals: 3 and 5
pL[1]
#returns a Collateral object with two collaterals: 4 and 2
pL.append(9)
#returns None
pL[2]
#returns a Collateral object with two collaterals: 9 and 9
pL.pop(0)
#returns a Collateral object with two collaterals: 3 and 5
#and pL is a Collateral object with two collaterals: [4, 9] and [2, 9]
pL[0]
#returns a Collateral object with two collaterals: 4 and 2
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for collateral-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bf1753fd63e90ecd4e80f92cc6006c69584a96a748d7beed0a8f5c3c5ca103b |
|
MD5 | 3a697a09bba2d5aeb96cf5d87c81077d |
|
BLAKE2b-256 | b0542dcfa3d5f01287728d8bf1a0966cb0dbba119a89c30240c0b9f5ed10f1ed |