Read only Python Class Attributes
This package provides a decorator to make read only attributes on a given Python class
Install
pip install read_only_class_attributes
Usage
from read_only_class_attributed import read_only
#example for all read only attributes
@read_only('*')
class _CONSTANTS:
pi = 3.14159
G = 6.67430e-11
CONSTANTS = _CONSTANTS()
#example for some read only attributes
@read_only('pi', 'G')
class _PLANETCONSTANTS:
pi = 3.14159
G = 6.67430e-11
g = 9.18 #can change
planet = 'Earth' #can change
PLANETCONSTANTS = _PLANETCONSTANTS()
Release files for read-only-class-attributes 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| read_only_class_attributes-1.0.1.tar.gz | 18.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| read_only_class_attributes-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.6 kB
Release files / read_only_class_attributes-1.0.1.tar.gz
| Download URL | read_only_class_attributes-1.0.1.tar.gz |
|---|---|
| Size | 18.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dce2d82f0fb2977f8fe5aca24681ce77f0cbdb449f1a086f9e6b9144d8bcd354
|
|
BLAKE2b-256 checksum How to use checksums |
a85cd33e9467d9771de944d59a5d0773f9182f2eccde69fd9736a50b0ff859e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.1
|
Release files / read_only_class_attributes-1.0.1-py3-none-any.whl
| Download URL | read_only_class_attributes-1.0.1-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80f8cebfc3d56ffe1bff0b1a51b2c04b7c38e2ba62a1c5f57790448c17036948
|
|
BLAKE2b-256 checksum How to use checksums |
a0b9740d8c94b349718850bd022397ac032fc459b4dd458b456eec035e9ca30a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.1
|