From 8bd9669d3d5dcdf8998ebdd0f964a4f3c99300d9 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Wed, 15 Jun 2016 21:20:35 -0700 Subject: [PATCH] Removed unused implements --- graphene/__init__.py | 2 -- graphene/types/__init__.py | 3 +-- graphene/types/objecttype.py | 16 ---------------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/graphene/__init__.py b/graphene/__init__.py index 827a6340..3178c08c 100644 --- a/graphene/__init__.py +++ b/graphene/__init__.py @@ -2,7 +2,6 @@ from .types import ( ObjectType, InputObjectType, Interface, - implements, Field, InputField, Schema, @@ -18,7 +17,6 @@ __all__ = [ 'ObjectType', 'InputObjectType', 'Interface', - 'implements', 'Field', 'InputField', 'Schema', diff --git a/graphene/types/__init__.py b/graphene/types/__init__.py index bf0de0fe..d226b3e5 100644 --- a/graphene/types/__init__.py +++ b/graphene/types/__init__.py @@ -1,4 +1,4 @@ -from .objecttype import ObjectType, implements +from .objecttype import ObjectType from .interface import Interface from .scalars import Scalar, String, ID, Int, Float, Boolean from .schema import Schema @@ -12,7 +12,6 @@ __all__ = [ 'ObjectType', 'InputObjectType', 'Interface', - 'implements', 'Enum', 'Field', 'InputField', diff --git a/graphene/types/objecttype.py b/graphene/types/objecttype.py index 9e899da4..fcfd85cc 100644 --- a/graphene/types/objecttype.py +++ b/graphene/types/objecttype.py @@ -105,22 +105,6 @@ class ObjectTypeMeta(InterfaceTypeMeta): return issubclass(cls, ObjectType) -def implements(*interfaces): - # This function let us decorate a ObjectType - # Adding a specified interfaces into the graphql_type - def wrap_class(cls): - interface_types = get_interfaces(cls, interfaces) - graphql_type = cls._meta.graphql_type - # fields = cls._build_field_map(interface_types, graphql_type.get_fields().values()) - new_type = copy.copy(graphql_type) - new_type._provided_interfaces = tuple(graphql_type._provided_interfaces) + tuple(interface_types) - new_type._fields = graphql_type._fields - cls._meta.graphql_type = new_type - cls._meta.graphql_type.check_interfaces() - return cls - return wrap_class - - class ObjectType(six.with_metaclass(ObjectTypeMeta)): def __init__(self, *args, **kwargs):