def basic_attr(name, doc):
    """Create a basic attribute for the TestAttribute class. This
    will produce a property object with a getter and setter that
    simply retrieve or set the value in the self._attrs dictionary."""

    prop = property(
        fget=lambda self: self._attrs.get(name, None),
        fset=lambda self, val: self._attrs.__setitem__(name, val),
        doc=doc
    )

    return prop