From 5d671697a537e909e5c962cf1c3decd5d8cabec4 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Thu, 7 Mar 2019 18:19:04 -0800 Subject: [PATCH] Fix missing type annotations --- graphene/types/base.py | 7 +++++++ graphene/types/scalars.py | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/graphene/types/base.py b/graphene/types/base.py index aa97ed22..fa366a10 100644 --- a/graphene/types/base.py +++ b/graphene/types/base.py @@ -1,6 +1,13 @@ +import six + from ..utils.subclass_with_meta import SubclassWithMeta from ..utils.trim_docstring import trim_docstring +if six.PY3: + from typing import Type +else: + Type = type + class BaseOptions(object): name = None # type: str diff --git a/graphene/types/scalars.py b/graphene/types/scalars.py index dfb63e52..350e2a97 100644 --- a/graphene/types/scalars.py +++ b/graphene/types/scalars.py @@ -4,6 +4,11 @@ from graphql.language.ast import BooleanValue, FloatValue, IntValue, StringValue from .base import BaseOptions, BaseType from .unmountedtype import UnmountedType +if six.PY3: + from typing import Any +else: + Any = object + class ScalarOptions(BaseOptions): pass