Skip to content
Advertisement

Is it possible to change the attribute value in the enum?

I need to reassign the attribute value in Enum.

JavaScript

I tried to reassign the attribute, but I got:

AttributeError: cannot reassign member ‘number’

Advertisement

Answer

Author’s note: This is a horrible idea.


Let’s just delete the string "1" from Python and replace it with "2"

JavaScript

You don’t have the "1" anymore, quite literally.

JavaScript

which sure is a tad concerning…

Advertisement