Files
openide/python/testData/inspections/PyCompatibilityInspection/asyncComprehensions.py
Semyon Proshev 464ade6789 PY-20770 Fixed: Support Python 3.6 asynchronous generators and comprehensions
Update CompatibilityVisitor to highlight "async" inside comprehensions and generator expressions in Pythons < 3.6
2016-09-30 18:06:02 +03:00

16 lines
2.0 KiB
Python

<warning descr="Python versions < 3.5 do not support this syntax">async</warning> def asyncgen():
<warning descr="Python version 3.5 does not support 'yield' inside async functions">yield 10</warning>
<warning descr="Python versions < 3.5 do not support this syntax">async</warning> def run():
<warning descr="Python version 2.4, 2.5, 2.6, 3.0 do not support set comprehensions">{i <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for i in asyncgen()}</warning>
[i <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for i in asyncgen()]
<warning descr="Python version 2.4, 2.5, 2.6, 3.0 do not support dictionary comprehensions">{i: i ** 2 <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for i in asyncgen()}</warning>
(i ** 2 <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for i in asyncgen())
list(i <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for i in asyncgen())
dataset = <warning descr="Python version 2.4, 2.5, 2.6, 3.0 do not support set comprehensions">{data for line in gen()
<warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for data in line
if check(data)}</warning>
dataset = <warning descr="Python version 2.4, 2.5, 2.6, 3.0 do not support set comprehensions">{data <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for line in asyncgen()
<warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for data in line
if check(data)}</warning>