Skip to content

Commit 561b9e9

Browse files
Add NoReturn type hints for __iter__ and __contains__
1 parent ca2066a commit 561b9e9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎src/netCDF4/__init__.pyi‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ class Dataset:
384384
def has_bzip2_filter(self) -> bool: ...
385385
def has_szip_filter(self) -> bool: ...
386386
def __getitem__(self, elem: str) -> Any: ... # should be Group | Variable, but this causes too many problems
387+
# __iter__ and __contains__ always error because iteration and membership ops are not allowed
388+
def __iter__(self) -> NoReturn: ...
389+
def __contains__(self, key) -> NoReturn: ...
387390
def __setattr__(self, name: str, value: Any) -> None: ...
388391
def __getattr__(self, name: str) -> Any: ...
389392
def __delattr__(self, name: str): ...

0 commit comments

Comments
 (0)