Raymond Hettinger added the comment:
This isn't a bug.
In Python 2, True and False are variable names rather than keywords. That
means they can be shadowed:
>>> False = 10
>>> True = 20
>>> [False, True]
[10, 20]
A Counter() is a kind a dictionary that returns zero rather than raising a
New submission from wang xuancong :
We all know that since:
[False, True, False].count(True) gives 1
eval('[False, True, False].count(True)') also gives 1.
However, in Python 2,
eval('[False, True, False].count(True)', {}, Counter()) gives 3, while
eval('[False, True, False].count(True)', {}, {