An elegant structure package
Project description
Introduction
The elegant-structure module contains data structures to make code more elegant.
Install
pip install elegant-structure
or update
pip install --upgrade elegant-structure
Usage
from elegant_structure import Pool
class Test:
def __init__(self, x, y):
self.x = x
self.y = y
test_pool = Pool(Test, verbose=True)
x = test_pool.add(1, 2)
y = test_pool.add(3, 4)
test_pool.remove(x)
test1 = test_pool[x]
if test1:
print(test1.x, test1.y)
test2 = test_pool[y]
if test2:
print(test2.x, test2.y)
the item is not exist in pool.
3 4
License
elegant-io is a free software. See the file LICENSE for the full text.
Authors
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
Built Distribution
Close
Hashes for elegant_structure-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c4cdc7dce55ae7d3744a7e91e93c316e555977774b799e7b2c430bb54bc9e5d |
|
MD5 | c9f9d5c0aa0a3db7fd8f0f6b6909e97d |
|
BLAKE2b-256 | 2effdada3d5f4f6c91ee02a3a104dba22e1a3703578b906ab1b2e7e3ebf3687b |