字符串缓存中注释存在错误?
pruidong opened this issue · 5 comments
pruidong commented
>>>a, b = "wtf!", "wtf!"
>>>a is b # 仅适用于3.7版本以下, 3.7以后的返回结果为False.
True
上述代码在Python 3.8中运行同样为True.注释存在错误.
运行环境: IDLE / Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
相关连接地址.
leisurelicht commented
我本地下载个3.8试一下
pruidong commented
>>> [(yield x) for x in some_iterable]
SyntaxError: 'yield' inside list comprehension
>>> [(yield x) for x in some_iterable]
SyntaxError: 'yield' inside list comprehension
>>> list([(yield x) for x in some_iterable])
SyntaxError: 'yield' inside list comprehension
>>> list((yield x) for x in some_iterable)
SyntaxError: 'yield' inside generator expression
>>> list(some_func((yield x)) for x in some_iterable)
SyntaxError: 'yield' inside generator expression
3.8中的idle运行上面的语句报错.
https://github.com/leisurelicht/wtfpython-cn#-yielding-none%E7%94%9F%E6%88%90-none
leisurelicht commented
>>> [(yield x) for x in some_iterable] SyntaxError: 'yield' inside list comprehension >>> [(yield x) for x in some_iterable] SyntaxError: 'yield' inside list comprehension >>> list([(yield x) for x in some_iterable]) SyntaxError: 'yield' inside list comprehension >>> list((yield x) for x in some_iterable) SyntaxError: 'yield' inside generator expression >>> list(some_func((yield x)) for x in some_iterable) SyntaxError: 'yield' inside generator expression
3.8中的idle运行上面的语句报错.
https://github.com/leisurelicht/wtfpython-cn#-yielding-none%E7%94%9F%E6%88%90-none
3.8中把这个bug修复了,看这里.
leisurelicht commented
>>>a, b = "wtf!", "wtf!" >>>a is b # 仅适用于3.7版本以下, 3.7以后的返回结果为False. True
上述代码在Python 3.8中运行同样为True.注释存在错误.
运行环境: IDLE / Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
相关连接地址.
我觉得应该是3.8中ast的实现方式有更新,不过我没在 new list 中找到说明。
pruidong commented
好的,谢谢.