[issue40853] "set() in set()" should raise TypeError: unhashable type: 'set'

2020-06-03 Thread yesheng
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

[issue40853] "set() in set()" should raise TypeError: unhashable type: 'set'

2020-06-03 Thread yesheng
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): File

[issue35273] 'eval' in generator expression behave different in dict from list

2018-11-18 Thread yesheng
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 NameError 2.7.11 (v

[issue35273] 'eval' in generator expression behave different in dict from list

2018-11-18 Thread yesheng
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')}) yyy() # ok zzz() # NameError: name 'a' is not defined, however in yyy() it