@@ -1739,28 +1739,16 @@ def argsort(self, *args, **kwargs):
17391739 return result .argsort (* args , ** kwargs )
17401740
17411741 def __add__ (self , other ):
1742- if is_list_like (other ):
1743- warnings .warn ("using '+' to provide set union with Indexes is "
1744- "deprecated, use '|' or .union()" , FutureWarning ,
1745- stacklevel = 2 )
1746- if isinstance (other , Index ):
1747- return self .union (other )
17481742 return Index (np .array (self ) + other )
17491743
17501744 def __radd__ (self , other ):
1751- if is_list_like (other ):
1752- warnings .warn ("using '+' to provide set union with Indexes is "
1753- "deprecated, use '|' or .union()" , FutureWarning ,
1754- stacklevel = 2 )
17551745 return Index (other + np .array (self ))
17561746
17571747 __iadd__ = __add__
17581748
17591749 def __sub__ (self , other ):
1760- warnings .warn ("using '-' to provide set differences with Indexes is "
1761- "deprecated, use .difference()" , FutureWarning ,
1762- stacklevel = 2 )
1763- return self .difference (other )
1750+ raise TypeError ("cannot perform __sub__ with this index type: "
1751+ "{typ}" .format (typ = type (self )))
17641752
17651753 def __and__ (self , other ):
17661754 return self .intersection (other )
@@ -1990,7 +1978,8 @@ def symmetric_difference(self, other, result_name=None):
19901978 -----
19911979 ``symmetric_difference`` contains elements that appear in either
19921980 ``idx1`` or ``idx2`` but not both. Equivalent to the Index created by
1993- ``(idx1 - idx2) + (idx2 - idx1)`` with duplicates dropped.
1981+ ``idx1.difference(idx2) | idx2.difference(idx1)`` with duplicates
1982+ dropped.
19941983
19951984 Examples
19961985 --------
@@ -3333,8 +3322,8 @@ def _evaluate_compare(self, other):
33333322 cls .__ge__ = _make_compare (operator .ge )
33343323
33353324 @classmethod
3336- def _add_numericlike_set_methods_disabled (cls ):
3337- """ add in the numeric set-like methods to disable """
3325+ def _add_numeric_methods_add_sub_disabled (cls ):
3326+ """ add in the numeric add/sub methods to disable """
33383327
33393328 def _make_invalid_op (name ):
33403329 def invalid_op (self , other = None ):
@@ -3349,7 +3338,7 @@ def invalid_op(self, other=None):
33493338
33503339 @classmethod
33513340 def _add_numeric_methods_disabled (cls ):
3352- """ add in numeric methods to disable """
3341+ """ add in numeric methods to disable other than add/sub """
33533342
33543343 def _make_invalid_op (name ):
33553344 def invalid_op (self , other = None ):
0 commit comments