Skip to main content

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


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)

Uploaded Source

Built Distribution

map_as_object-0.0.1-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page