diff options
| author | Bas van Beek <b.f.van.beek@vu.nl> | 2021-09-22 16:04:37 +0200 |
|---|---|---|
| committer | Bas van Beek <b.f.van.beek@vu.nl> | 2021-09-24 17:01:27 +0200 |
| commit | b55a6e41e187abd3851441482b97cbc736e993f3 (patch) | |
| tree | 43eb571d19f9088225bc7553526e6fb9270cddcb /numpy | |
| parent | 61bb56bac811e8e2a970dd56e9457c5b9a4d74da (diff) | |
| download | numpy-b55a6e41e187abd3851441482b97cbc736e993f3.tar.gz | |
MAINT: Change the `npyio` recarray dtypes from `void` to `record`
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/lib/npyio.pyi | 5 | ||||
| -rw-r--r-- | numpy/typing/tests/data/reveal/npyio.py | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/numpy/lib/npyio.pyi b/numpy/lib/npyio.pyi index 4841e9e71..8fd36ca6f 100644 --- a/numpy/lib/npyio.pyi +++ b/numpy/lib/npyio.pyi @@ -29,6 +29,7 @@ from numpy import ( generic, float64, void, + record, ) from numpy.ma.mrecords import MaskedRecords @@ -240,7 +241,7 @@ def recfromtxt( *, usemask: L[False] = ..., **kwargs: Any, -) -> recarray[Any, dtype[void]]: ... +) -> recarray[Any, dtype[record]]: ... @overload def recfromtxt( fname: str | os.PathLike[str] | Iterable[str] | Iterable[bytes], @@ -255,7 +256,7 @@ def recfromcsv( *, usemask: L[False] = ..., **kwargs: Any, -) -> recarray[Any, dtype[void]]: ... +) -> recarray[Any, dtype[record]]: ... @overload def recfromcsv( fname: str | os.PathLike[str] | Iterable[str] | Iterable[bytes], diff --git a/numpy/typing/tests/data/reveal/npyio.py b/numpy/typing/tests/data/reveal/npyio.py index d66201dd3..bee97a8e1 100644 --- a/numpy/typing/tests/data/reveal/npyio.py +++ b/numpy/typing/tests/data/reveal/npyio.py @@ -82,10 +82,10 @@ reveal_type(np.genfromtxt(str_path, delimiter="\n")) # E: numpy.ndarray[Any, nu reveal_type(np.genfromtxt(str_path, ndmin=2)) # E: numpy.ndarray[Any, numpy.dtype[{float64}]] reveal_type(np.genfromtxt(["1", "2", "3"], ndmin=2)) # E: numpy.ndarray[Any, numpy.dtype[{float64}]] -reveal_type(np.recfromtxt(bytes_file)) # E: numpy.recarray[Any, numpy.dtype[numpy.void]] +reveal_type(np.recfromtxt(bytes_file)) # E: numpy.recarray[Any, numpy.dtype[numpy.record]] reveal_type(np.recfromtxt(pathlib_path, usemask=True)) # E: numpy.ma.mrecords.MaskedRecords[Any, numpy.dtype[numpy.void]] -reveal_type(np.recfromtxt(["1", "2", "3"])) # E: numpy.recarray[Any, numpy.dtype[numpy.void]] +reveal_type(np.recfromtxt(["1", "2", "3"])) # E: numpy.recarray[Any, numpy.dtype[numpy.record]] -reveal_type(np.recfromcsv(bytes_file)) # E: numpy.recarray[Any, numpy.dtype[numpy.void]] +reveal_type(np.recfromcsv(bytes_file)) # E: numpy.recarray[Any, numpy.dtype[numpy.record]] reveal_type(np.recfromcsv(pathlib_path, usemask=True)) # E: numpy.ma.mrecords.MaskedRecords[Any, numpy.dtype[numpy.void]] -reveal_type(np.recfromcsv(["1", "2", "3"])) # E: numpy.recarray[Any, numpy.dtype[numpy.void]] +reveal_type(np.recfromcsv(["1", "2", "3"])) # E: numpy.recarray[Any, numpy.dtype[numpy.record]] |
