diff --git a/CHANGES.rst b/CHANGES.rst index 670fae10e18..9830ee16b47 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -283,7 +283,7 @@ Other Changes and Additions - ``astropy.table`` - - Sped up setting of ``Column`` slices by an order of magnitude. [#2994] + - Sped up setting of ``Column`` slices by an order of magnitude. [#2994, #3020] - Updated the bundled ``six`` module to version 1.7.3 and made 1.7.3 the minimum acceptable version of ``six``. [#2814] diff --git a/astropy/table/column.py b/astropy/table/column.py index e82319c8438..ae58c3b637b 100644 --- a/astropy/table/column.py +++ b/astropy/table/column.py @@ -210,6 +210,11 @@ def __ne__(self, other): def __setitem__(self, index, value): self.data[index] = value + # Set slices using a view of the underlying data, as it gives an + # order-of-magnitude speed-up. Only gets called in Python 2. [#3020] + def __setslice__(self, start, stop, value): + self.data.__setslice__(start, stop, value) + def __array_finalize__(self, obj): # Obj will be none for direct call to Column() creator if obj is None: