Python Enum: Stop using magical numbers in your Python code, try to use Enum like a pro

Learn to use Enum to make your code cleaner and more readable

Lynn G. Kwong

--

When I read the Python code of some people, I can often see some hardcoded magical numbers. For example, some may hard code the user status to 1 or 0 depending on whether the user is active or not. However, these magical numbers are difficult to read and update.

--

--

Lynn G. Kwong

I’m a Software Developer (https://medium.com/@lynn-kwong) keen on sharing thoughts, tutorials, and solutions for the best practice of software development.