From 98c1d1dcb7d0eb2f1d8c95cc1b05506b537fc176 Mon Sep 17 00:00:00 2001 From: Dmitry Shvetsov Date: Sat, 19 Dec 2020 13:53:07 +1000 Subject: [PATCH] feat: start enum val with buffer, count from top It is good to have buffers between enum values. And start counting from the "top of the hierarchy" value, the Director, to the bottom because it is unlikely that a lot of values will be added on top of the Director. --- .../object_oriented_design/call_center/call_center.ipynb | 6 +++--- .../object_oriented_design/call_center/call_center.py | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/solutions/object_oriented_design/call_center/call_center.ipynb b/solutions/object_oriented_design/call_center/call_center.ipynb index c540c6a6..83439fbb 100644 --- a/solutions/object_oriented_design/call_center/call_center.ipynb +++ b/solutions/object_oriented_design/call_center/call_center.ipynb @@ -69,9 +69,9 @@ "\n", "class Rank(Enum):\n", "\n", - " OPERATOR = 0\n", - " SUPERVISOR = 1\n", - " DIRECTOR = 2\n", + " OPERATOR = 30\n", + " SUPERVISOR = 20\n", + " DIRECTOR = 10\n", "\n", "\n", "class Employee(metaclass=ABCMeta):\n", diff --git a/solutions/object_oriented_design/call_center/call_center.py b/solutions/object_oriented_design/call_center/call_center.py index 1d5e7bc6..1a295053 100644 --- a/solutions/object_oriented_design/call_center/call_center.py +++ b/solutions/object_oriented_design/call_center/call_center.py @@ -5,10 +5,9 @@ from enum import Enum class Rank(Enum): - OPERATOR = 0 - SUPERVISOR = 1 - DIRECTOR = 2 - + OPERATOR = 30 + SUPERVISOR = 20 + DIRECTOR = 10 class Employee(metaclass=ABCMeta):