def __setitem__(self, key, value):
        """Sets cell code and resets result cache"""

        # Prevent unchanged cells from being recalculated on cursor movement

        repr_key = repr(key)

        unchanged = (repr_key in self.result_cache and
                     value == self(key)) or \
                    ((value is None or value == "") and
                     repr_key not in self.result_cache)

        DataArray.__setitem__(self, key, value)

        if not unchanged:
            # Reset result cache
            self.result_cache = {}
def __setitem__ ( self , key , value ) : repr_key = repr ( key ) unchanged = ( repr_key in self . result_cache and value == self ( key ) ) or ( ( value is None or value == "" ) and repr_key not in self . result_cache ) DataArray . __setitem__ ( self , key , value ) if not unchanged : self . result_cache = { }
Sets cell code and resets result cache