hashable Enum#1461
Conversation
erikwrede
left a comment
There was a problem hiding this comment.
Thanks for the PR! Small comment, other than that it is good to merge! 🚀
| RED = 1 | ||
| GREEN = 2 | ||
| BLUE = 3 | ||
|
|
There was a problem hiding this comment.
This should also include the instance-creation pattern for enums, to ensure completeness:
https://docs.graphene-python.org/en/latest/types/enums/#definition
Episode = graphene.Enum('Episode', [('NEWHOPE', 4), ('EMPIRE', 5), ('JEDI', 6)])There was a problem hiding this comment.
Thanks! I added a test in my amended commit.
Codecov ReportBase: 95.87% // Head: 95.88% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1461 +/- ##
=======================================
Coverage 95.87% 95.88%
=======================================
Files 50 50
Lines 1722 1724 +2
=======================================
+ Hits 1651 1653 +2
Misses 71 71
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
Thank you! |
It would be convenient for
graphene.Enumto be hashable the same wayenum.Enumis so that it can be used as a key in a dict or a member of a set.