From 0dca8ef1c88b3ef8d721fd2cec023e93c5d7b41e Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Thu, 25 Jun 2020 10:59:22 +0100 Subject: [PATCH] Tweak enum examples --- docs/types/enums.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/types/enums.rst b/docs/types/enums.rst index 02cc267c..a3215cad 100644 --- a/docs/types/enums.rst +++ b/docs/types/enums.rst @@ -61,7 +61,8 @@ you can add description etc. to your enum without changing the original: graphene.Enum.from_enum( AlreadyExistingPyEnum, - description=lambda v: return 'foo' if v == AlreadyExistingPyEnum.Foo else 'bar') + description=lambda v: return 'foo' if v == AlreadyExistingPyEnum.Foo else 'bar' + ) Notes @@ -76,6 +77,7 @@ In the Python ``Enum`` implementation you can access a member by initing the Enu .. code:: python from enum import Enum + class Color(Enum): RED = 1 GREEN = 2 @@ -89,6 +91,7 @@ However, in Graphene ``Enum`` you need to call get to have the same effect: .. code:: python from graphene import Enum + class Color(Enum): RED = 1 GREEN = 2