Skip to content

Commit ec67566

Browse files
jschendelPingviinituutti
authored andcommitted
CLN: Remove sentinel_factory() in favor of object() (pandas-dev#25074)
1 parent 28468d8 commit ec67566

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

pandas/core/common.py

-7
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,6 @@ def standardize_mapping(into):
401401
return into
402402

403403

404-
def sentinel_factory():
405-
class Sentinel(object):
406-
pass
407-
408-
return Sentinel()
409-
410-
411404
def random_state(state=None):
412405
"""
413406
Helper function for processing random_state arguments.

pandas/io/formats/html.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from pandas.core.dtypes.generic import ABCMultiIndex
1313

1414
from pandas import compat
15-
import pandas.core.common as com
1615
from pandas.core.config import get_option
1716

1817
from pandas.io.common import _is_url
@@ -190,7 +189,7 @@ def _write_col_header(self, indent):
190189

191190
if self.fmt.sparsify:
192191
# GH3547
193-
sentinel = com.sentinel_factory()
192+
sentinel = object()
194193
else:
195194
sentinel = False
196195
levels = self.columns.format(sparsify=sentinel, adjoin=False,
@@ -386,7 +385,7 @@ def _write_hierarchical_rows(self, fmt_values, indent):
386385

387386
if self.fmt.sparsify:
388387
# GH3547
389-
sentinel = com.sentinel_factory()
388+
sentinel = object()
390389
levels = frame.index.format(sparsify=sentinel, adjoin=False,
391390
names=False)
392391

pandas/io/formats/style.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@ def _get_level_lengths(index, hidden_elements=None):
13221322
13231323
Result is a dictionary of (level, inital_position): span
13241324
"""
1325-
sentinel = com.sentinel_factory()
1325+
sentinel = object()
13261326
levels = index.format(sparsify=sentinel, adjoin=False, names=False)
13271327

13281328
if hidden_elements is None:

0 commit comments

Comments
 (0)