Class
zope.i18n.locales.inheritance.AttributeInheritance

Implementation of locale inheritance for attributes.

Example:

>>> from zope.i18n.locales.tests.test_docstrings import \
...     LocaleInheritanceStub

>>> root = LocaleInheritanceStub()
>>> root.data = 'value'
>>> root.attr = 'bar value'
>>> root.data2 = AttributeInheritance()
>>> root.data2.attr = 'value2'

>>> locale = LocaleInheritanceStub(root)
>>> locale.attr = 'foo value'
>>> locale.data2 = AttributeInheritance()

Here is an attribute lookup directly from the locale:

>>> locale.data
'value'
>>> locale.attr
'foo value'

... however, we can also have any amount of nesting:

>>> locale.data2.attr
'value2'

Once we have looked up a particular attribute, it should be cached, i.e. exist in the dictionary of this inheritance object:

>>> 'attr' in locale.data2.__dict__
True
>>> locale.data2.__dict__['attr']
'value2'

Make sure that None can be assigned as value as well:

>>> locale.data2.attr = None
>>> locale.data2.attr is None
True

Base classes

Implemented Interfaces

Attributes/Properties

There are no attributes in this class.

Methods

Known Subclasses