mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-22 01:26:49 +03:00
chore: Use typing.TYPE_CHECKING
instead of MYPY (#1503)
Co-authored-by: Erik Wrede <erikwrede@users.noreply.github.com>
This commit is contained in:
parent
c636d984c6
commit
d77d0b0571
|
@ -1,11 +1,12 @@
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .base import BaseOptions, BaseType
|
from .base import BaseOptions, BaseType
|
||||||
from .inputfield import InputField
|
from .inputfield import InputField
|
||||||
from .unmountedtype import UnmountedType
|
from .unmountedtype import UnmountedType
|
||||||
from .utils import yank_fields_from_attrs
|
from .utils import yank_fields_from_attrs
|
||||||
|
|
||||||
# For static type checking with Mypy
|
# For static type checking with type checker
|
||||||
MYPY = False
|
if TYPE_CHECKING:
|
||||||
if MYPY:
|
|
||||||
from typing import Dict, Callable # NOQA
|
from typing import Dict, Callable # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .base import BaseOptions, BaseType
|
from .base import BaseOptions, BaseType
|
||||||
from .field import Field
|
from .field import Field
|
||||||
from .utils import yank_fields_from_attrs
|
from .utils import yank_fields_from_attrs
|
||||||
|
|
||||||
# For static type checking with Mypy
|
# For static type checking with type checker
|
||||||
MYPY = False
|
if TYPE_CHECKING:
|
||||||
if MYPY:
|
|
||||||
from typing import Dict, Iterable, Type # NOQA
|
from typing import Dict, Iterable, Type # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ..utils.deprecated import warn_deprecation
|
from ..utils.deprecated import warn_deprecation
|
||||||
from ..utils.get_unbound_function import get_unbound_function
|
from ..utils.get_unbound_function import get_unbound_function
|
||||||
from ..utils.props import props
|
from ..utils.props import props
|
||||||
|
@ -6,9 +8,8 @@ from .objecttype import ObjectType, ObjectTypeOptions
|
||||||
from .utils import yank_fields_from_attrs
|
from .utils import yank_fields_from_attrs
|
||||||
from .interface import Interface
|
from .interface import Interface
|
||||||
|
|
||||||
# For static type checking with Mypy
|
# For static type checking with type checker
|
||||||
MYPY = False
|
if TYPE_CHECKING:
|
||||||
if MYPY:
|
|
||||||
from .argument import Argument # NOQA
|
from .argument import Argument # NOQA
|
||||||
from typing import Dict, Type, Callable, Iterable # NOQA
|
from typing import Dict, Type, Callable, Iterable # NOQA
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .base import BaseOptions, BaseType, BaseTypeMeta
|
from .base import BaseOptions, BaseType, BaseTypeMeta
|
||||||
from .field import Field
|
from .field import Field
|
||||||
from .interface import Interface
|
from .interface import Interface
|
||||||
|
@ -7,9 +9,8 @@ try:
|
||||||
from dataclasses import make_dataclass, field
|
from dataclasses import make_dataclass, field
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ..pyutils.dataclasses import make_dataclass, field # type: ignore
|
from ..pyutils.dataclasses import make_dataclass, field # type: ignore
|
||||||
# For static type checking with Mypy
|
# For static type checking with type checker
|
||||||
MYPY = False
|
if TYPE_CHECKING:
|
||||||
if MYPY:
|
|
||||||
from typing import Dict, Iterable, Type # NOQA
|
from typing import Dict, Iterable, Type # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .base import BaseOptions, BaseType
|
from .base import BaseOptions, BaseType
|
||||||
from .unmountedtype import UnmountedType
|
from .unmountedtype import UnmountedType
|
||||||
|
|
||||||
# For static type checking with Mypy
|
# For static type checking with type checker
|
||||||
MYPY = False
|
if TYPE_CHECKING:
|
||||||
if MYPY:
|
|
||||||
from .objecttype import ObjectType # NOQA
|
from .objecttype import ObjectType # NOQA
|
||||||
from typing import Iterable, Type # NOQA
|
from typing import Iterable, Type # NOQA
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user