Skip to content

Commit 4de8b0b

Browse files
authored
base_dataset.getitem return-type is Optional
1 parent c4958e4 commit 4de8b0b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cleanvision/dataset/base_dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from collections.abc import Sized
4-
from typing import List, Union
4+
from typing import List, Union, Optional
55

66
from PIL import Image
77

@@ -20,7 +20,7 @@ def __len__(self) -> int:
2020
"""Returns the number of examples in the dataset"""
2121
raise NotImplementedError
2222

23-
def __getitem__(self, item: Union[int, str]) -> Image.Image:
23+
def __getitem__(self, item: Union[int, str]) -> Optional[Image.Image]:
2424
"""Returns the image at a given index"""
2525
raise NotImplementedError
2626

0 commit comments

Comments
 (0)