GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - dwt/valueobject: ValueObject is a dict-like object that exposes keys as attributes.

BranchesTags
Open more actions menu

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
valueobject
valueobject
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
Hacking.md
Hacking.md
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
setup.py
setup.py
 
 
tox.ini
tox.ini
 
 

Repository files navigation

ValueObject Build Status

License: ISC - See LICENSE file

ValueObject is a dict-like object that exposes keys as attributes. You can use it like a regular dictionary (in fact, it is a subclass and does not override its __init__). You can use attribute or item access to get or set values.

>>> from valueobject import ValueObject
>>> vo = ValueObject(key=1)
>>> vo['key']
1
>>> vo.key
1
>>> vo['key'] += 1
>>> vo.key += 1
>>> vo['key']
3
>>> vo.key
3

Usability notes:

  • If you need to access a key that is not a valid Python identifier (for example, it includes spaces), use regular dict access.
  • All regular object, dict and ValueObject methods will be returned on attribute access. A key such as copy needs to be accessed via item access syntax (e.g. valueobject['copy']).

Changelog

  • 1.0.3: Minor build fixes, to make the setup.py file python3 safe. While the rest of the library was python3 safe all along, that file was not… 😬

About

ValueObject is a dict-like object that exposes keys as attributes.

Resources

Readme
ISC license
Activity

Stars

0 stars

Watchers

3 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.