Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Commit

Permalink
Added hint for ndarray.__new__ (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
bedder authored and shoyer committed Jul 7, 2019
1 parent 57eedfd commit a57ec56
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions numpy-stubs/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,20 @@ class _ArrayOrScalarCommon(
# TODO(shoyer): remove when all methods are defined
def __getattr__(self, name) -> Any: ...

_BufferType = Union[ndarray, bytes, bytearray, memoryview]

class ndarray(_ArrayOrScalarCommon, Iterable, Sized, Container):
real: ndarray
imag: ndarray
def __new__(
cls,
shape: Sequence[int],
dtype: Union[_DtypeLike, str] = ...,
buffer: _BufferType = ...,
offset: int = ...,
strides: _ShapeLike = ...,
order: Optional[str] = ...,
) -> ndarray: ...
@property
def dtype(self) -> _Dtype: ...
@dtype.setter
Expand Down

0 comments on commit a57ec56

Please sign in to comment.