Skip to content

Commit

Permalink
TYP: add type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Nov 26, 2021
1 parent e226035 commit dbbdae4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions yt/utilities/on_demand_imports.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
from importlib import import_module
from typing import Optional
from types import ModuleType
from typing import Dict, Optional, Union

if sys.version_info >= (3, 8):
from functools import cached_property
Expand Down Expand Up @@ -36,7 +37,7 @@ class OnDemandImport:

def __init__(self, name: str, instructions: Optional[str] = None):
self._name = name
self._submodules = {}
self._submodules: Dict[str, Union[ModuleType, "OnDemandImport"]] = {}
msg = f"Failed to import an optional dependency from yt ({self._name})."
if instructions:
msg += f"\n{instructions}"
Expand Down

0 comments on commit dbbdae4

Please sign in to comment.