# Buggy code
def convert_objects(
    self, datetime=False, numeric=False, timedelta=False, coerce=False, copy=True
):
    """
    Attempt to infer better dtype for object columns

    Parameters
    ----------
    datetime : boolean, default False
        If True, convert to date where possible.
    numeric : boolean, default False
        If True, attempt to convert to numbers (including strings), with
        unconvertible values becoming NaN.
    timedelta : boolean, default False
        If True, convert to timedelta where possible.
    coerce : boolean, default False
        If True, force conversion with unconvertible values converted to
        nulls (NaN or NaT)
    copy : boolean, default True
        If True, return a copy even if no copy is necessary (e.g. no
        conversion was done). Note: This is meant for internal use, and
        should not be confused with inplace.

    Returns
    -------
    converted : same as input object
    """
    return self._constructor(
        self._data.convert(
            datetime=datetime,
            numeric=numeric,
            timedelta=timedelta,
            coerce=coerce,
            copy=copy,
        )
    ).__finalize__(self)


# Traceback (TypeError)
In [1]: from datetime import datetime

In [2]: s = pd.Series([datetime(2001,1,1,0,0), 'foo', 1.0, 1,
...:                pd.Timestamp('20010104'), '20010105'], dtype='O')

In [5]: s.convert_objects(convert_dates='coerce')
c:\users\vdbosscj\scipy\pandas-joris\pandas\util\decorators.py:81: FutureWarning
: the 'convert_dates' keyword is deprecated, use 'datetime' instead
warnings.warn(msg, FutureWarning)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-b962b638ac86> in <module>()
----> 1 s.convert_objects(convert_dates='coerce')

c:\users\vdbosscj\scipy\pandas-joris\pandas\util\decorators.pyc in wrapper(*args
, **kwargs)
86                 else:
87                     kwargs[new_arg_name] = new_arg_value
---> 88             return func(*args, **kwargs)
89         return wrapper
90     return _deprecate_kwarg

c:\users\vdbosscj\scipy\pandas-joris\pandas\util\decorators.pyc in wrapper(*args
, **kwargs)
86                 else:
87                     kwargs[new_arg_name] = new_arg_value
---> 88             return func(*args, **kwargs)
89         return wrapper
90     return _deprecate_kwarg

c:\users\vdbosscj\scipy\pandas-joris\pandas\util\decorators.pyc in wrapper(*args
, **kwargs)
86                 else:
87                     kwargs[new_arg_name] = new_arg_value
---> 88             return func(*args, **kwargs)
89         return wrapper
90     return _deprecate_kwarg

c:\users\vdbosscj\scipy\pandas-joris\pandas\core\generic.py in convert_objects(s
elf, datetime, numeric, timedelta, coerce, copy)
2468                                timedelta=timedelta,
2469                                coerce=coerce,
-> 2470                                copy=copy)).__finalize__(self)
2471
2472     #-------------------------------------------------------------------

---

c:\users\vdbosscj\scipy\pandas-joris\pandas\core\internals.py in convert(self, *
*kwargs)
3459         """ convert the whole block as one """
3460         kwargs['by_item'] = False
-> 3461         return self.apply('convert', **kwargs)
3462
3463     @property

c:\users\vdbosscj\scipy\pandas-joris\pandas\core\internals.py in apply(self, f,
axes, filter, do_integrity_check, **kwargs)
2467                                                  copy=align_copy)
2468
-> 2469             applied = getattr(b, f)(**kwargs)
2470
2471             if isinstance(applied, list):

c:\users\vdbosscj\scipy\pandas-joris\pandas\core\internals.py in convert(self, d
atetime, numeric, timedelta, coerce, copy, by_item)
1493                 timedelta=timedelta,
1494                 coerce=coerce,
-> 1495                 copy=copy
1496             ).reshape(self.values.shape)
1497             blocks.append(make_block(values,

c:\users\vdbosscj\scipy\pandas-joris\pandas\core\common.py in _possibly_convert_
objects(values, datetime, numeric, timedelta, coerce, copy)
1897     """ if we have an object dtype, try to coerce dates and/or numbers "
""
1898
-> 1899     conversion_count = sum((datetime, numeric, timedelta))
1900     if conversion_count == 0:
1901         import warnings

TypeError: unsupported operand type(s) for +: 'int' and 'str'

# Fixed code
def convert_objects(
    self, datetime=False, numeric=False, timedelta=False, coerce=False, copy=True
):
    """
    Attempt to infer better dtype for object columns

    Parameters
    ----------
    datetime : boolean, default False
        If True, convert to date where possible.
    numeric : boolean, default False
        If True, attempt to convert to numbers (including strings), with
        unconvertible values becoming NaN.
    timedelta : boolean, default False
        If True, convert to timedelta where possible.
    coerce : boolean, default False
        If True, force conversion with unconvertible values converted to
        nulls (NaN or NaT)
    copy : boolean, default True
        If True, return a copy even if no copy is necessary (e.g. no
        conversion was done). Note: This is meant for internal use, and
        should not be confused with inplace.

    Returns
    -------
    converted : same as input object
    """

    # Deprecation code to handle usage change
    issue_warning = False
    if datetime == "coerce":
        datetime = coerce = True
        numeric = timedelta = False
        issue_warning = True
    elif numeric == "coerce":
        numeric = coerce = True
        datetime = timedelta = False
        issue_warning = True
    elif timedelta == "coerce":
        timedelta = coerce = True
        datetime = numeric = False
        issue_warning = True
    if issue_warning:
        warnings.warn(
            "The use of 'coerce' as an input is deprecated. Instead set coerce=True.",
            FutureWarning,
        )

    return self._constructor(
        self._data.convert(
            datetime=datetime,
            numeric=numeric,
            timedelta=timedelta,
            coerce=coerce,
            copy=copy,
        )
    ).__finalize__(self)