From e86f73d30c20f8cf6aae2586970084d86e758a4d Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Tue, 11 Jul 2017 22:52:38 -0700 Subject: [PATCH] Added class arguments example for Python 3 --- UPGRADE-v2.0.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/UPGRADE-v2.0.md b/UPGRADE-v2.0.md index 28a2034c..2a46a005 100644 --- a/UPGRADE-v2.0.md +++ b/UPGRADE-v2.0.md @@ -16,6 +16,7 @@ ``` With 2.0: + ```python class CommonFields(object): name = String() @@ -23,3 +24,21 @@ class Pet(CommonFields, Interface): pass ``` + +* Meta options as class arguments (**ONLY PYTHON 3**). + + Before: + + ```python + class Dog(ObjectType): + class Meta: + interfaces = [Pet] + name = String() + ``` + + With 2.0: + + ```python + class Dog(ObjectType, interfaces=[Pet]): + name = String() + ```