* Thanks to Tavis Rudd for raising a lot of these issues and tackling them
in NameMapper.py. I have made the first big steps in incorporating his
ideas into NamedValueAccess.py.
The importance of NameValueAccess is that it is a likely candidate for use
in the construction of a templating system. It is also currently used in
WebKit logging and I believe somewhere in MiddleKit.
BTW if you submit patches for NamedValueAccess, please add new cases to the
test suite and verify that all tests pass.
* New function valueForKey() works on any object and __getitem__ enabled
object. See doc string for details.
* New function valueForName() supports the "dotted.notation" and uses
* Renamed handledUnknownGetKey() to valueForUnknownKey(), which now takes
an additional parameter: the default value.
* Made exception NamedValueAccessError inherit LookupError. Added more
* MiscUtils.__init__.py used to augment UserDict to make it "named value
accessible". That code has been moved to NamedValueAccess.py
* UserDict.valueForKey() raises a ValueForKeyError now instead of KeyError.
* Test suite
- Moved to Testing/TestNamedValueAccess
- Use unit test
- Add new cases
* What's left?
Well for the full story, see the TO DO list in the doc string of
In particular, the functions do not cache bindings to named values, while
the mix-in does. At the very least, the mix-in should have an option not to
cache bindings and also, perhaps the functions should have an option to do so.
One of the deciding factors would be performance, but I haven't yet set up
Get latest updates about Open Source Projects, Conferences and News.