@@ -691,14 +691,19 @@ def _formatter(self, formatter=None):
691
691
Parameters
692
692
----------
693
693
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.
702
707
703
708
Returns
704
709
-------
0 commit comments