Define a object via a map of attributes, not by class and constructor
Project description
map_as_object
Sometimes, you want to define an oject without an class. Thus this package allows you to define an object via a map of its attributes:
m = as_object({'a': 1})
assert m.a == 1
You can even assign lambdas in that way.
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
map-as-object-0.0.1.tar.gz
(6.3 kB
view details)
Built Distribution
File details
Details for the file map-as-object-0.0.1.tar.gz
.
File metadata
- Download URL: map-as-object-0.0.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02400a18cc5ba55105cdb386aa571bb5d09295daadd77cf6d958aa78624c07d8 |
|
MD5 | 1d9412c765d5afafcfe693d5adc07bc1 |
|
BLAKE2b-256 | e1d998950da53de7ec504fb2d7a9b68e60a5e13d20f83d8edcbe289d44e4a814 |
File details
Details for the file map_as_object-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: map_as_object-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a810b4b1395407b75b0dddae52f0308ba0c8c76c71ea1f35dd16bda342657ef |
|
MD5 | fc5b814447597b085aab343f0ba4ef72 |
|
BLAKE2b-256 | 5bbecd76732b699bab2f354d4171b98a8b2d9f996afa5f5fe3a6e2faabc167a0 |