Consider the following piece of code:
In [1]: a = {'ϵ': 1}
In [2]: b = dict(ϵ=1)
In [3]: a == b
Out[3]: False
In [4]: print(a, b)
{'ϵ': 1} {'ε': 1}
I was surprised to find out that a
is not equal to b
. It appears that the resulting dicts use distinct Unicode symbols for epsilon, despite having similar definitions (I type \epsilon
+ tab in my IPython environment).
I wonder why this happens and if there is a preferred way to handle Unicode keys in this situation.