A simple pythonic module to lock (make read-only) and hide class attributes
Project description
attribmanager
A simple pythonic module to lock (make read-only) and hide class attributes
Installation
pip install attribmanager
Usage
import attribmanger
class example(attribmanger.manage):
def __init__(self):
self.mylist = ["item 1", "item2"]
self.lock("mylist")
# mylist is read only and cannot be edited now, changing it
# will raise an error,
self.myvar = "foo"
self.hide("myvar")
# myvar will not show up anywhere, and cannot be edited
self.unhide("myvar")
# Hiding an object without being able to unhide it would be
# the same as deleting it, that's why you can unhide it
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
attribmanager-1.0.tar.gz
(2.6 kB
view details)
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file attribmanager-1.0.tar.gz.
File metadata
- Download URL: attribmanager-1.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
187301adff1778564630496803b49e06a84886f97f4cbc65c56473c4c6ceb93f
|
|
| MD5 |
59d347d1df601d7a4f57575f86570f18
|
|
| BLAKE2b-256 |
ef2efab392bbda49362243b5176753b5f8f306b08a2bfb57febc006b91271eb0
|
File details
Details for the file attribmanager-1.0.0-py3-none-any.whl.
File metadata
- Download URL: attribmanager-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c6eb3b15c8051fe4f9d3df85064776dfdfa030b57292f7b2e7d9cc8e85cb939
|
|
| MD5 |
9b49eb972e61c0ba42dd1e8e91c9a2fa
|
|
| BLAKE2b-256 |
3fbd231fb97b2a32dee65d8007fa267f2ad3d584f8b7717360196d2b9adea1d2
|
File details
Details for the file attribmanager-1.0-py2.py3-none-any.whl.
File metadata
- Download URL: attribmanager-1.0-py2.py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c7645cbfd627bfa48184775be4fc63dda9b22c7529810e549e211546cbee934
|
|
| MD5 |
d97beae866aaac6b8743b8622d1ae00d
|
|
| BLAKE2b-256 |
4d86ec23e4202d367862ac050770936a5200abbccff11e58f82290f5d3a981c0
|