Skip to content

Commit 2364546

Browse files
committed
fixup! fixup! use repr
1 parent 439f2f8 commit 2364546

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

pandas/core/arrays/base.py

+13-8
Original file line numberDiff line numberDiff line change
@@ -691,14 +691,19 @@ def _formatter(self, formatter=None):
691691
Parameters
692692
----------
693693
formatter: GenericArrayFormatter, optional
694-
The formatter this array is being rendered with. This will be
695-
passed when the ExtensionArray is being rendered inside of a
696-
Series, Index, or DataFrame. This will be ``None`` when called
697-
from a top-level ``repr(array)``.
698-
699-
By default, when ``formatter`` is passed, the return value
700-
is ``formatter.formatter``. Otherwise, the default formatter
701-
is ``repr``.
694+
The formatter this array is being rendered with. When the array
695+
is being rendered inside an Index, Series, or DataFrame, a
696+
formatter will be provided. So if you want your objects to
697+
render differently inside a Series from on its own, checking
698+
with ``formatter is None`` is an option.
699+
700+
The default behavior depends on whether `formatter` is passed.
701+
702+
* When `formatter` is None, :func:`repr` is returned.
703+
* When `formatter` is passed, ``formatter.formatter`` is used,
704+
which falls back to :func:`repr` if that isn't specified.
705+
706+
In general, just returning :func:`repr` should be fine.
702707
703708
Returns
704709
-------

0 commit comments

Comments
 (0)