dictones-0.1.1
توضیحات
Little bit better than dict
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | dictones-0.1.1 |
| نام | dictones |
| نسخه کتابخانه | 0.1.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | to101 |
| ایمیل نویسنده | to101kv@gmail.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/dictones/ |
| مجوز | - |
## Description
Like dict, but a little bit better
# install
```
pip install dictones
```
#### import
```python
from dictones import DictOnes
```
#### Usage
# 1. Added constructor
```python
filled_dict = DictOnes('first_key, second_key', 'to first key', 'to second key')
print(filled_dict.first_key)
print(filled_dict.second_key)
```
#### Output
```http
'to first key'
'to second_key'
```
# 2. Constructor without filling
```python
filled_dict = DictOnes('first_key, second_key')
print(filled_dict.first_key)
print(filled_dict.second_key)
print(filled_dict.key)
```
#### Output
```http
None
None
...raise KeyError(attrname)
KeyError: 'key'
```
# 3. Deleting
```python
filled_dict = DictOnes('first_key, second_key')
print(filled_dict.first_key)
print(filled_dict.second_key)
print('second_key' in filled_dict)
del filled_dict.second_key
print('second_key' in filled_dict)
```
#### Output
```http
None
None
True
False
```
# Otherwise it is the same dict
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.1,<4.0 | Python |
نحوه نصب
نصب پکیج whl dictones-0.1.1:
pip install dictones-0.1.1.whl
نصب پکیج tar.gz dictones-0.1.1:
pip install dictones-0.1.1.tar.gz