def create_accessor(attr, deletable=False):
        # Getter is simple; no processing needed.
        @property
        def accessor(self):
            return getattr(self, attr)

        # Setter is more complicated.
        @accessor.setter
        def accessor(self, value):
            # Store the original value in case we need to reset.
            original = getattr(self, attr)

            # If this was originally autoset or not.
            was_autoset = attr in self._autoset

            # Discard this attribute from the autoset list.
            self._autoset.discard(attr)

            # Set the value and see if it is valid.
            setattr(self, attr, value)
            try:
                self._calculate()
            except:
                # Reset to the original state.
                setattr(self, attr, original)
                if was_autoset:
                    self._autoset.add(attr)

                # Let the error propogate up.
                raise

        # Create a deleter if allowable.
        if deletable:
            @accessor.deleter
            def accessor(self):
                self._autoset.add(attr)
                setattr(self, attr, None)
                self._calculate()

        # And we now have our accessor.
        return accessor