We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dda393d commit cadeddaCopy full SHA for cadedda
tensordict/typedtensordict.py
@@ -5,7 +5,6 @@
5
6
from __future__ import annotations
7
8
-import typing
9
from collections.abc import Sequence
10
from typing import Any, ClassVar
11
@@ -61,7 +60,7 @@ def _get_td_dir() -> frozenset[str]:
61
60
def _is_not_required(tp: Any) -> bool:
62
"""Check whether a type annotation is NotRequired[T]."""
63
origin = getattr(tp, "__origin__", None)
64
- if origin is typing.NotRequired:
+ if origin is NotRequired:
65
return True
66
origin = getattr(tp, "__class__", None)
67
if origin is not None and getattr(origin, "__name__", None) == "_SpecialForm":
0 commit comments