Skip to content

Commit 56aad0f

Browse files
committed
Sync PackageMetadata with email.message.Message
Signed-off-by: Filipe Laíns <[email protected]>
1 parent 5475a6e commit 56aad0f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

importlib_metadata/_meta.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ._compat import Protocol
2-
from typing import Any, Dict, Iterator, List, TypeVar, Union
2+
from typing import Any, Dict, Iterator, List, Optional, TypeVar, Union, overload
33

44

55
_T = TypeVar("_T")
@@ -18,7 +18,12 @@ def __getitem__(self, key: str) -> str:
1818
def __iter__(self) -> Iterator[str]:
1919
... # pragma: no cover
2020

21-
def get_all(self, name: str, failobj: _T = ...) -> Union[List[Any], _T]:
21+
@overload
22+
def get_all(self, name: str, failobj: None = None) -> Optional[List[Any]]:
23+
...
24+
25+
@overload
26+
def get_all(self, name: str, failobj: _T) -> Union[List[Any], _T]:
2227
"""
2328
Return all values associated with a possibly multi-valued key.
2429
"""

0 commit comments

Comments
 (0)