File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11"""The Undefined value"""
22
33from __future__ import annotations
4- from typing_extensions import Self
54
65import warnings
6+ from typing import TYPE_CHECKING
7+
8+ if TYPE_CHECKING :
9+ try :
10+ from typing import Self
11+ except ImportError : # Python < 3.11
12+ from typing_extensions import Self
713
814__all__ = ["Undefined" , "UndefinedType" ]
915
1016
1117class UndefinedType :
1218 """Auxiliary class for creating the Undefined singleton."""
1319
14- _instance : UndefinedType | None = None
20+ _instance : Self | None = None
1521
1622 def __new__ (cls ) -> Self :
1723 """Create the Undefined singleton."""
Original file line number Diff line number Diff line change 1414 cast ,
1515 overload ,
1616)
17- from typing_extensions import Self
1817
1918if TYPE_CHECKING :
2019 from typing import TypeAlias , TypeGuard
6059if TYPE_CHECKING :
6160 from .schema import GraphQLSchema
6261
62+ try :
63+ from typing import Self
64+ except ImportError : # Python < 3.11
65+ from typing_extensions import Self
66+
6367
6468__all__ = [
6569 "GraphQLAbstractType" ,
You can’t perform that action at this time.
0 commit comments