DDD Value Objects implementation
Project description
- Info:
DDD Value Objects implementation.
Features
Value object can’t be changed once created
Two objects with the same values are considered equal
Access to values after dot: value.my_value
Access to values like dict: value[‘my_value’]
Installation
pip install vo
Package: https://pypi.python.org/pypi/vo
Example
from vo import Value
value1 = Value(test=True, some_text="I am some text string")
value2 = Value(some_text="I am some text string", test=True)
value3 = Value(purpose_of_life=42)
assert(value1 == value1) # True
assert(value1 == value2) # True
assert(value1 == value3) # False
print(value3.purpose_of_life) # 42
print(value3['purpose_of_life']) # 42
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
vo-0.2.0.tar.gz
(16.3 kB
view hashes)
Built Distribution
vo-0.2.0-py3-none-any.whl
(5.0 kB
view hashes)