esets-0.2.0
توضیحات
Extended sets
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | esets-0.2.0 |
| نام | esets |
| نسخه کتابخانه | 0.2.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Frey Waid |
| ایمیل نویسنده | logophage1@gmail.com |
| آدرس صفحه اصلی | https://github.com/freywaid/esets |
| آدرس اینترنتی | https://pypi.org/project/esets/ |
| مجوز | MIT license |
# eset
Extended sets - support for set complement
## Overview
An `eset` works like a normal python `set` except that you can invert it to generate its
complement. For example, let's say you have the following:
```
>>> from esets import eset
>>> s = eset(['hello', 'there'])
>>> s_invert = ~s
>>> s_invert
~eset(['hello', 'there'])
```
In this example, `s_invert` contains everything _except_ `'hello'` and `'there'`.
## Logic
All the logic operations you'd expect from sets are available in esets, including
intersection, union, difference, and symmetric difference. Use the `&`, `|`, `-`, and `^`
operators respectively.
Similarly, conditional expressions are available to determine subset relationships.
If `A <= B`, that A is a subset of B.
### Infinities
You'll note there's an `inf.py` module that implement `א0` and `א1` infinities, that
is, countable and uncountable infinities. This was implemented so that cardinality
calculations would be correct for complement sets: discussed below.
```
>>> from esets import inf
>>> inf.countable, inf.uncountable
(א0, א1)
>>> inf.countable < inf.uncountable
True
```
### Cardinality
The `abs` expression (also `cardinality` method) will return a countably infinite scalar
if in complement mode; otherwise it returns the count of items in set.
```
>>> from esets import eset, inf
>>> s = eset(['hello', 'there'])
>>> abs(s)
2
>>> abs(~s)
א0
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl esets-0.2.0:
pip install esets-0.2.0.whl
نصب پکیج tar.gz esets-0.2.0:
pip install esets-0.2.0.tar.gz