Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLN: Remove sentinel_factory() in favor of object() #25074

Merged
merged 2 commits into from
Feb 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,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