Skip to content

Commit

Permalink
CLN: Remove sentinel_factory() in favor of object() (pandas-dev#25074)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschendel authored and Pingviinituutti committed Feb 28, 2019
1 parent 28468d8 commit ec67566
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
7 changes: 0 additions & 7 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions pandas/io/formats/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion pandas/io/formats/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ec67566

Please sign in to comment.