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 hashes)
Built Distribution
Close
Hashes for map_as_object-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a810b4b1395407b75b0dddae52f0308ba0c8c76c71ea1f35dd16bda342657ef |
|
MD5 | fc5b814447597b085aab343f0ba4ef72 |
|
BLAKE2b-256 | 5bbecd76732b699bab2f354d4171b98a8b2d9f996afa5f5fe3a6e2faabc167a0 |