You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The enum implementation separates the creation of the enum type object and setting the enum values into two steps. The method of adding the enum modifies a whole bunch of private attributes to make it work. Why don't we ask for all the enum values in the constructor and build the whole class in one function call, just like how we would do in Python code? I feel this will make the code much simpler and isolated from implementation detail changes in Python.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
The enum implementation separates the creation of the enum type object and setting the enum values into two steps. The method of adding the enum modifies a whole bunch of private attributes to make it work. Why don't we ask for all the enum values in the constructor and build the whole class in one function call, just like how we would do in Python code? I feel this will make the code much simpler and isolated from implementation detail changes in Python.
Beta Was this translation helpful? Give feedback.
All reactions