yesheng added the comment:
thanks, it sounds reasonable.
is it possible to make dict give consistent result?
{1,2} in {frozenset({1,2}):3}
# to return True
--
___
Python tracker
<https://bugs.python.org/issue40
New submission from yesheng :
>>> set() in set()
False # should raise TypeError
>>> dict() in set()
Traceback (most recent call last):
File "", line 1, in
TypeError: unhashable type: 'dict'
>>> set() in dict()
Traceback (most recent call last
yesheng <13611358...@139.com> added the comment:
I tried again, and could not reproduce on 3.6.7, latest update:
For 3.6.7: Both yyy() and zzz() got NameError
For 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]
yyy() got ['abc', 'abd']
zzz() got
New submission from yesheng <13611358...@139.com>:
def yyy():
a, b = 'abc', 'abd'
print([eval(i) for i in ('a', 'b')])
def zzz():
a, b = 'abc', 'abd'
print({i: eval(i) for i in ('a', 'b')}