From fb02c2567e56232605bb288019affb6c383151dc Mon Sep 17 00:00:00 2001 From: Jeremy Schendel Date: Sat, 2 Feb 2019 15:41:27 -0700 Subject: [PATCH] CLN: Remove sentinel_factory() in favor of object() (#25074) --- pandas/core/common.py | 7 ------- pandas/io/formats/html.py | 5 ++--- pandas/io/formats/style.py | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/pandas/core/common.py b/pandas/core/common.py index 8bdff9d0b1a84..0e92a5056daae 100644 --- a/pandas/core/common.py +++ b/pandas/core/common.py @@ -401,13 +401,6 @@ def standardize_mapping(into): return into -def sentinel_factory(): - class Sentinel(object): - pass - - return Sentinel() - - def random_state(state=None): """ Helper function for processing random_state arguments. diff --git a/pandas/io/formats/html.py b/pandas/io/formats/html.py index f41749e0a7745..2d8b40016c9af 100644 --- a/pandas/io/formats/html.py +++ b/pandas/io/formats/html.py @@ -12,7 +12,6 @@ from pandas.core.dtypes.generic import ABCMultiIndex from pandas import compat -import pandas.core.common as com from pandas.core.config import get_option from pandas.io.common import _is_url @@ -190,7 +189,7 @@ def _write_col_header(self, indent): if self.fmt.sparsify: # GH3547 - sentinel = com.sentinel_factory() + sentinel = object() else: sentinel = False levels = self.columns.format(sparsify=sentinel, adjoin=False, @@ -386,7 +385,7 @@ def _write_hierarchical_rows(self, fmt_values, indent): if self.fmt.sparsify: # GH3547 - sentinel = com.sentinel_factory() + sentinel = object() levels = frame.index.format(sparsify=sentinel, adjoin=False, names=False) diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 598453eb92d25..61862ee0028d3 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -1322,7 +1322,7 @@ def _get_level_lengths(index, hidden_elements=None): Result is a dictionary of (level, inital_position): span """ - sentinel = com.sentinel_factory() + sentinel = object() levels = index.format(sparsify=sentinel, adjoin=False, names=False) if hidden_elements is None: