Skip to content

Commit

Permalink
BUG: Resolve a potential TypeError caused by typing.Any subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
BvB93 committed Jul 21, 2021
1 parent 64468fc commit 3b79a87
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions numpy/typing/_array_like.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
from __future__ import annotations

import sys
from typing import Any, overload, Sequence, TYPE_CHECKING, Union, TypeVar
from typing import (
Any,
overload,
Sequence,
TYPE_CHECKING,
Union,
TypeVar,
Generic,
)

from numpy import (
ndarray,
Expand Down Expand Up @@ -47,7 +55,8 @@
class _SupportsArray(Protocol[_DType_co]):
def __array__(self) -> ndarray[Any, _DType_co]: ...
else:
_SupportsArray = Any
class _SupportsArray(Generic[_DType_co]):
pass

# TODO: Wait for support for recursive types
_NestedSequence = Union[
Expand Down

0 comments on commit 3b79a87

Please sign in to comment.