Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 88885c5

Browse files
committed
Adjust mypy tests
1 parent 58706d8 commit 88885c5

File tree

5 files changed

+3
-16
lines changed

5 files changed

+3
-16
lines changed

doc/source/reference/routines.io.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,3 @@ Binary format description
8989
:toctree: generated/
9090

9191
lib.format
92-
93-
Object wrappers
94-
---------------
95-
.. autosummary::
96-
:toctree: generated/
97-
98-
lib.npyio.BagObj

numpy/lib/_npyio_impl.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
overrides.array_function_dispatch, module='numpy')
3636

3737

38-
@set_module('numpy.lib.npyio')
3938
class BagObj:
4039
"""
4140
BagObj(obj)
@@ -49,7 +48,7 @@ class BagObj:
4948
5049
Examples
5150
--------
52-
>>> from numpy.lib.npyio import BagObj as BO
51+
>>> from numpy.lib._npyio_impl import BagObj as BO
5352
>>> class BagDemo:
5453
... def __getitem__(self, key): # An instance of BagObj(BagDemo)
5554
... # will call this method when any

numpy/lib/npyio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from ._npyio_impl import BagObj, DataSource, NpzFile
1+
from ._npyio_impl import DataSource, NpzFile

numpy/lib/npyio.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from numpy.lib._npyio_impl import (
2-
BagObj as BagObj,
32
DataSource as DataSource,
43
NpzFile as NpzFile,
54
)

numpy/typing/tests/data/reveal/npyio.pyi

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ pathlib_path: pathlib.Path
1010
str_file: IO[str]
1111
bytes_file: IO[bytes]
1212

13-
bag_obj: np.lib.npyio.BagObj[int]
1413
npz_file: np.lib.npyio.NpzFile
1514

1615
AR_i8: npt.NDArray[np.int64]
@@ -26,15 +25,12 @@ class BytesReader:
2625
bytes_writer: BytesWriter
2726
bytes_reader: BytesReader
2827

29-
reveal_type(bag_obj.a) # E: int
30-
reveal_type(bag_obj.b) # E: int
31-
3228
reveal_type(npz_file.zip) # E: zipfile.ZipFile
3329
reveal_type(npz_file.fid) # E: Union[None, typing.IO[builtins.str]]
3430
reveal_type(npz_file.files) # E: list[builtins.str]
3531
reveal_type(npz_file.allow_pickle) # E: bool
3632
reveal_type(npz_file.pickle_kwargs) # E: Union[None, typing.Mapping[builtins.str, Any]]
37-
reveal_type(npz_file.f) # E: lib.npyio.BagObj[lib.npyio.NpzFile]
33+
reveal_type(npz_file.f) # E: lib._npyio_impl.BagObj[lib.npyio.NpzFile]
3834
reveal_type(npz_file["test"]) # E: ndarray[Any, dtype[Any]]
3935
reveal_type(len(npz_file)) # E: int
4036
with npz_file as f:

0 commit comments

Comments
 (0)