Skip to content

Commit 45f8e94

Browse files
mypy
1 parent a43a82d commit 45f8e94

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

mp_api/client/core/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from mp_api.client.core.settings import MAPI_CLIENT_SETTINGS
2828

2929
if TYPE_CHECKING:
30+
from collections.abc import Iterable
3031
from typing import Any, Literal
3132

3233
from pydantic._internal._model_construction import ModelMetaclass
@@ -246,8 +247,8 @@ def __getattr__(self, v: str) -> Any:
246247
f"has no attribute {v}"
247248
)
248249

249-
def __dir__(self) -> list[str]:
250-
return self._obj.__dir__()
250+
def __dir__(self) -> Iterable[str]:
251+
return self._obj.__dir__() if hasattr(self._obj, "__dir__") else []
251252

252253

253254
class MPDataset:

0 commit comments

Comments
 (0)