Fixing A String Issue with Enum.name in Mypy

Not all strings are the same when assigning to a variable.

Photo by Mel Poole on Unsplash
color = Color.WHITE.name.capitalize() if self._color else \                 Color.BLACK.name.capitalize()
color = Color(self._color).name.capitalize()
color = str(Color(self._color).name).capitalize()

--

--

C.D. Reimer makes topical videos about comic cons, pop culture, Silicon Valley and technology on YouTube. https://www.youtube.com/cdreimer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
C.D. Reimer

C.D. Reimer makes topical videos about comic cons, pop culture, Silicon Valley and technology on YouTube. https://www.youtube.com/cdreimer