def METHOD_NAME(df: pd.DataFrame) -> pd.DataFrame:
    """Return `df` with `str.strip` applied to columns with `object` dtype."""
    def strip_series(col):
        if col.dtypes == object:
            return col.str.strip()
        else:
            return col
    return df.apply(strip_series, axis=0)