Skip to main content

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

qrcode_for_wechat_official_account

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

elegant_structure-0.0.1.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

elegant_structure-0.0.1-py3-none-any.whl (2.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page