Today I tried to pass some of my "final" values (members of my class) from the class to Enum. I ran the unittests that I wrote, and noticed that the tests needed a lot longer than before. When I returned these "final" values to the class, everything returned to the old speed again. Here is an example of how I accessed them when they were at Enum:
class SpecialCharacters(Enum):
TONE_NUMBERS = ["0", "1", "2", "3", "4"]
Access it as follows:
SpecialCharacters.TONE_NUMBERS.value
An example of accessing values when they are in a class:
self.TONE_NUMBERS
So I wonder why my tests take 3 times (!) As much time as I put the values in Enum. It should be a simple call to members of another class, but I don’t think it will make much difference.
( , , , .)
python - 3.4.