TYP: ExtensionArray unique and repeat
Typing fixes for `ExtensionArray.unique()` and `ExtensionArray.repeat()`

Right, my thought is making those Literal would make it more obvious to
readers that it is for DataFrame

On Sun, May 2, 2021 at 6:57 PM Irv Lustig ***@***.***> wrote:

> *@Dr-Irv* commented on this pull request.
> ------------------------------
>
> In pandas/core/arrays/interval.py
> <https://github.com/pandas-dev/pandas/pull/41260#discussion_r624845240>:
>
> > @@ -1518,7 +1518,11 @@ def delete(self: IntervalArrayT, loc) -> IntervalArrayT:
>          return self._shallow_copy(left=new_left, right=new_right)
>
>      @Appender(_extension_array_shared_docs["repeat"] % _shared_docs_kwargs)
> -    def repeat(self: IntervalArrayT, repeats: int, axis=None) -> IntervalArrayT:
> +    def repeat(
> +        self: IntervalArrayT,
> +        repeats: int | Sequence[int],
> +        axis: int | None = None,
>
> @jbrockmendel <https://github.com/jbrockmendel> No, we can't accept those
> arguments in ExtensionArray.repeat(), because we call numpy.repeat
>
> —
> You are receiving this because you were mentioned.
>
>
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/41260#discussion_r624845240>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AB5UM6DILM4G7I7URYA2SDTTLX7I7ANCNFSM4364DQ3A>
> .
>
 > Right, my thought is making those Literal would make it more obvious to readers that it is for DataFrame

@jbrockmendel Except that there is no `DataFrame.repeat()`, so I'm not sure what you mean here.  pd._typing.Axis is intended for use in Series/DataFrame methods, not in EA methods.  But that is not obvious to all readers (as evidenced by the initial suggestion to use it here).  So I was suggesting an edit that might make it clearer to the next reader.

Out of scope for this PR. > as

right my main point here is that we should have exactly 1 canonical way to type things and it should be obvious. If its not it needs lots of comments / expl and is not ideal at all, otherwise we are going to get inconsistencies across the board. if there is a way to enforce this would be great.

in any event this PR is fine.