Commit 1e07ba1c authored by Semyon Proshev's avatar Semyon Proshev
Browse files

Avoid duplicate messages in compatibility inspection and unsupported features annotator (PY-33516)

Inspection does not register `CompatibilityVisitor` problems for its opened file language because in such a case
`UnsupportedFeatures` will annotate them.
Also `registerOnFirstMatchingVersion` methods were removed because
they could lead to duplication even if languages to register were different.
parent 4611c748
Showing with 165 additions and 162 deletions
+165 -162
......@@ -204,8 +204,7 @@ public class PyCompatibilityInspection extends PyInspection {
registerForAllMatchingVersions(level -> unsupportedMethods.getOrDefault(level, Collections.emptySet()).contains(functionName),
" not have method " + functionName,
node,
null);
node);
}
}
......@@ -215,8 +214,7 @@ public class PyCompatibilityInspection extends PyInspection {
!myUsedImports.contains(functionName)) {
registerForAllMatchingVersions(level -> UnsupportedFeaturesUtil.BUILTINS.get(level).contains(functionName),
" not have method " + functionName,
node,
null);
node);
}
}
else if (resolvedCallee instanceof PyTargetExpression) {
......@@ -227,8 +225,7 @@ public class PyCompatibilityInspection extends PyInspection {
PyBuiltinCache.getInstance(resolvedCallee).isBuiltin(resolvedCallee)) {
registerForAllMatchingVersions(level -> UnsupportedFeaturesUtil.BUILTINS.get(level).contains(PyNames.TYPE_LONG),
" not have type long. Use int instead.",
node,
null);
node);
}
}
}
......@@ -256,8 +253,7 @@ public class PyCompatibilityInspection extends PyInspection {
registerForAllMatchingVersions(level -> UnsupportedFeaturesUtil.MODULES.get(level).contains(moduleName) && !BACKPORTED_PACKAGES.contains(moduleName),
" not have module " + moduleName,
importElement,
null);
importElement);
}
}
......@@ -287,8 +283,7 @@ public class PyCompatibilityInspection extends PyInspection {
registerForAllMatchingVersions(level -> UnsupportedFeaturesUtil.MODULES.get(level).contains(moduleName) && !BACKPORTED_PACKAGES.contains(moduleName),
" not have module " + name,
source,
null);
source);
}
}
......@@ -364,14 +359,19 @@ public class PyCompatibilityInspection extends PyInspection {
warnAsyncAndAwaitAreBecomingKeywordsInPy37(node);
}
@Override
protected boolean registerForLanguageLevel(@NotNull LanguageLevel level) {
return level != LanguageLevel.forElement(myHolder.getFile());
}
private void warnAsyncAndAwaitAreBecomingKeywordsInPy37(@NotNull PsiNameIdentifierOwner nameIdentifierOwner) {
final PsiElement nameIdentifier = nameIdentifierOwner.getNameIdentifier();
if (nameIdentifier != null &&
ArrayUtil.contains(nameIdentifierOwner.getName(), PyNames.AWAIT, PyNames.ASYNC) &&
LanguageLevel.forElement(nameIdentifierOwner).isOlderThan(LanguageLevel.PYTHON37)) {
registerOnFirstMatchingVersion(level -> level.isAtLeast(LanguageLevel.PYTHON37),
"'async' and 'await' are keywords in Python 3.7 and newer",
registerForAllMatchingVersions(level -> level.isAtLeast(LanguageLevel.PYTHON37),
" not allow 'async' and 'await' as names",
nameIdentifier,
new PyRenameElementQuickFix(nameIdentifierOwner));
}
......
......@@ -2,4 +2,4 @@ def foo(**kwargs): pass
two = 0
kw = {}
foo(**kw, <error descr="Python versions < 3.5 do not allow keyword arguments after **expression">two=1</error>)
foo(**kw, <error descr="Python version 2.7 does not allow keyword arguments after **expression">two=1</error>)
......@@ -7,4 +7,4 @@ class Foo(object):
@classmethod
def test(cls):
cls(**kwargs, <error descr="Python versions < 3.5 do not allow keyword arguments after **expression">foo=1</error>)
\ No newline at end of file
cls(**kwargs, <error descr="Python version 2.7 does not allow keyword arguments after **expression">foo=1</error>)
\ No newline at end of file
......@@ -19,7 +19,7 @@ def f2(a, b, c=1, *d):
f2(c=3, *(1,2))
f2(1,2,3, *(1,2))
f2(*(1,2), c=20)
f2(*(1,2), <error descr="Python versions < 3.5 do not allow positional arguments after *expression">20</error>) # fail: positional past *
f2(*(1,2), <error descr="Python version 3.4 does not allow positional arguments after *expression">20</error>) # fail: positional past *
def f3(a=1, b=2, c=3, *d):
return a,b,c,d
......
......@@ -4,14 +4,14 @@ def foo(*args, **kwargs):
foo(0,
*[1],
<warning descr="Python versions < 3.5 do not allow positional arguments after *expression">2</warning>,
<warning descr="Python versions < 3.5 do not allow duplicate *expressions">*[3]</warning>,
<warning descr="Python versions < 3.5 do not allow positional arguments after *expression">4</warning>,
<warning descr="Python version 2.6, 2.7, 3.4 do not allow positional arguments after *expression">2</warning>,
<warning descr="Python version 2.6, 2.7, 3.4 do not allow duplicate *expressions">*[3]</warning>,
<warning descr="Python version 2.6, 2.7, 3.4 do not allow positional arguments after *expression">4</warning>,
a='a',
<warning descr="Python versions < 3.5 do not allow duplicate *expressions">*[6]</warning>,
<warning descr="Python version 2.6, 2.7, 3.4 do not allow duplicate *expressions">*[6]</warning>,
b='b',
<warning descr="Python versions < 3.5 do not allow duplicate *expressions">*[7]</warning>,
<warning descr="Python version 2.6, 2.7, 3.4 do not allow duplicate *expressions">*[7]</warning>,
c='c',
**{'d': 'd'},
<warning descr="Python versions < 3.5 do not allow keyword arguments after **expression">e='e'</warning>,
<warning descr="Python versions < 3.5 do not allow duplicate **expressions">**{'f': 'f'}</warning>)
<warning descr="Python version 2.6, 2.7, 3.4 do not allow keyword arguments after **expression">e='e'</warning>,
<warning descr="Python version 2.6, 2.7, 3.4 do not allow duplicate **expressions">**{'f': 'f'}</warning>)
<warning descr="Python versions < 3.5 do not support this syntax">async</warning> def foo(x):
<warning descr="Python versions < 3.5 do not support this syntax">async</warning> with x:
y = <warning descr="Python versions < 3.5 do not support this syntax">await x</warning>
if <warning descr="Python versions < 3.5 do not support this syntax">await y</warning>:
return <warning descr="Python versions < 3.5 do not support this syntax">await z</warning>
<warning descr="Python versions < 3.5 do not support this syntax">async</warning> for y in x:
<warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax">async</warning> def foo(x):
<warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax">async</warning> with x:
y = <warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax">await x</warning>
if <warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax">await y</warning>:
return <warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax">await z</warning>
<warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax">async</warning> for y in x:
pass
<warning descr="Python versions < 3.5 do not support this syntax">async</warning> def asyncgen():
<warning descr="Python version 2.6, 2.7, 3.4 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.6, 2.7, 3.4 do not support this syntax">async</warning> def run():
<warning descr="Python version 2.6 does 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.6 does 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>
......
<warning descr="Python versions < 3.5 do not support this syntax">async</warning> def async2():
[<warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> for fun in funcs]
<warning descr="Python version 2.6 does not support set comprehensions">{<warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> for fun in funcs}</warning>
<warning descr="Python version 2.6 does not support dictionary comprehensions">{fun: <warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> for fun in funcs}</warning>
<warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax">async</warning> def async2():
[<warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> for fun in funcs]
<warning descr="Python version 2.6 does not support set comprehensions">{<warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> for fun in funcs}</warning>
<warning descr="Python version 2.6 does not support dictionary comprehensions">{fun: <warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> for fun in funcs}</warning>
[<warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> for fun in funcs if <warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> smth</warning>]
<warning descr="Python version 2.6 does not support set comprehensions">{<warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> for fun in funcs if <warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> smth</warning>}</warning>
<warning descr="Python version 2.6 does not support dictionary comprehensions">{fun: <warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> for fun in funcs if <warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> smth</warning>}</warning>
[<warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> for fun in funcs if <warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> smth</warning>]
<warning descr="Python version 2.6 does not support set comprehensions">{<warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> for fun in funcs if <warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> smth</warning>}</warning>
<warning descr="Python version 2.6 does not support dictionary comprehensions">{fun: <warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> for fun in funcs if <warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> smth</warning>}</warning>
[<warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for fun in funcs]
<warning descr="Python version 2.6 does not support set comprehensions">{<warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for fun in funcs}</warning>
<warning descr="Python version 2.6 does not support dictionary comprehensions">{fun: <warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for fun in funcs}</warning>
[<warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for fun in funcs]
<warning descr="Python version 2.6 does not support set comprehensions">{<warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for fun in funcs}</warning>
<warning descr="Python version 2.6 does not support dictionary comprehensions">{fun: <warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for fun in funcs}</warning>
[<warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for fun in funcs if <warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> smth</warning>]
<warning descr="Python version 2.6 does not support set comprehensions">{<warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for fun in funcs if <warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> smth</warning>}</warning>
<warning descr="Python version 2.6 does not support dictionary comprehensions">{fun: <warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for fun in funcs if <warning descr="Python versions < 3.5 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> smth</warning>}</warning>
\ No newline at end of file
[<warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for fun in funcs if <warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> smth</warning>]
<warning descr="Python version 2.6 does not support set comprehensions">{<warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for fun in funcs if <warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> smth</warning>}</warning>
<warning descr="Python version 2.6 does not support dictionary comprehensions">{fun: <warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> fun()</warning> <warning descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</warning> for fun in funcs if <warning descr="Python version 2.6, 2.7, 3.4 do not support this syntax"><warning descr="Python version 3.5 does not support 'await' inside comprehensions">await</warning> smth</warning>}</warning>
\ No newline at end of file
xs = {1: 2}
ys = {<warning descr="Python versions < 3.5 do not support starred expressions in dicts">**xs</warning>, 3: 4}
ys = {<warning descr="Python version 2.6, 2.7, 3.4 do not support starred expressions in dicts">**xs</warning>, 3: 4}
def foo():
<warning descr="Python versions < 3.0 do not support '...' outside of sequence slicings.">...</warning>
<warning descr="Python version 2.6, 2.7 do not support '...' outside of sequence slicings.">...</warning>
<error descr="Python version 2.7 does not have module builtins"><warning descr="Python version 2.6, 2.7 do not have module builtins">import builtins</warning></error>
<error descr="Python version 2.7 does not have module builtins"><warning descr="Python version 2.6 does not have module builtins">import builtins</warning></error>
<warning descr="Python version 3.4, 3.5, 3.6, 3.7 do not have module __builtin__">import __builtin__</warning>
\ No newline at end of file
x <warning descr="Python versions < 3.5 do not support matrix multiplication operators">@</warning> y
x <warning descr="Python versions < 3.5 do not support matrix multiplication operators">@=</warning> y
x <warning descr="Python version 2.6, 2.7, 3.4 do not support matrix multiplication operators">@</warning> y
x <warning descr="Python version 2.6, 2.7, 3.4 do not support matrix multiplication operators">@=</warning> y
<warning descr="Python version >= 3.0 do not support this syntax. The print statement has been replaced with a print() function">print "One value"</warning>
\ No newline at end of file
<warning descr="Python version 3.4, 3.5, 3.6, 3.7 do not support this syntax. The print statement has been replaced with a print() function">print "One value"</warning>
\ No newline at end of file
t = (1, <warning descr="Python versions < 3.5 do not support starred expressions in tuples, lists, and sets">*(2, 3)</warning>)
a, <warning descr="Python versions < 3.0 do not support starred expressions as assignment targets">*b</warning>, c = t
t = (1, <warning descr="Python version 2.6, 2.7, 3.4 do not support starred expressions in tuples, lists, and sets">*(2, 3)</warning>)
a, <warning descr="Python version 2.6, 2.7 do not support starred expressions as assignment targets">*b</warning>, c = t
......@@ -2,22 +2,22 @@ a = u"String"
# Python 3.6
a = <error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 2.6, 2.7, 3.4, 3.5 do not support a 'F' prefix">f</warning></error>""
a = <error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 2.6, 2.7, 3.4, 3.5 do not support a 'F' prefix">F</warning></error>""
a = <error descr="Python version 2.7 does not support a 'RF' prefix"><warning descr="Python version 2.6, 2.7, 3.4, 3.5 do not support a 'RF' prefix">rf</warning></error>""
a = <error descr="Python version 2.7 does not support a 'FR' prefix"><warning descr="Python version 2.6, 2.7, 3.4, 3.5 do not support a 'FR' prefix">fr</warning></error>""
a = <error descr="Python version 2.7 does not support a 'FU' prefix"><warning descr="Python version 2.6, 2.7, 3.4, 3.5, 3.6, 3.7 do not support a 'FU' prefix">fu</warning></error>""
a = <error descr="Python version 2.7 does not support a 'UF' prefix"><warning descr="Python version 2.6, 2.7, 3.4, 3.5, 3.6, 3.7 do not support a 'UF' prefix">uf</warning></error>""
a = <error descr="Python version 2.7 does not support a 'BF' prefix"><warning descr="Python version 2.6, 2.7, 3.4, 3.5, 3.6, 3.7 do not support a 'BF' prefix">bf</warning></error>""
a = <error descr="Python version 2.7 does not support a 'FB' prefix"><warning descr="Python version 2.6, 2.7, 3.4, 3.5, 3.6, 3.7 do not support a 'FB' prefix">fb</warning></error>""
a = <error descr="Python version 2.7 does not support a 'UFR' prefix"><warning descr="Python version 2.6, 2.7, 3.4, 3.5, 3.6, 3.7 do not support a 'UFR' prefix">ufr</warning></error>""
a = <error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 2.6, 3.4, 3.5 do not support a 'F' prefix">f</warning></error>""
a = <error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 2.6, 3.4, 3.5 do not support a 'F' prefix">F</warning></error>""
a = <error descr="Python version 2.7 does not support a 'RF' prefix"><warning descr="Python version 2.6, 3.4, 3.5 do not support a 'RF' prefix">rf</warning></error>""
a = <error descr="Python version 2.7 does not support a 'FR' prefix"><warning descr="Python version 2.6, 3.4, 3.5 do not support a 'FR' prefix">fr</warning></error>""
a = <error descr="Python version 2.7 does not support a 'FU' prefix"><warning descr="Python version 2.6, 3.4, 3.5, 3.6, 3.7 do not support a 'FU' prefix">fu</warning></error>""
a = <error descr="Python version 2.7 does not support a 'UF' prefix"><warning descr="Python version 2.6, 3.4, 3.5, 3.6, 3.7 do not support a 'UF' prefix">uf</warning></error>""
a = <error descr="Python version 2.7 does not support a 'BF' prefix"><warning descr="Python version 2.6, 3.4, 3.5, 3.6, 3.7 do not support a 'BF' prefix">bf</warning></error>""
a = <error descr="Python version 2.7 does not support a 'FB' prefix"><warning descr="Python version 2.6, 3.4, 3.5, 3.6, 3.7 do not support a 'FB' prefix">fb</warning></error>""
a = <error descr="Python version 2.7 does not support a 'UFR' prefix"><warning descr="Python version 2.6, 3.4, 3.5, 3.6, 3.7 do not support a 'UFR' prefix">ufr</warning></error>""
# python 3.3
a = u""
a = r""
a = b""
a = <error descr="Python version 2.7 does not support a 'RB' prefix"><warning descr="Python version 2.6, 2.7 do not support a 'RB' prefix">rb</warning></error>""
a = <error descr="Python version 2.7 does not support a 'RB' prefix"><warning descr="Python version 2.6 does not support a 'RB' prefix">rb</warning></error>""
a = br""
# python 3.2, 3.1
......@@ -48,9 +48,9 @@ a = <warning descr="Python version 3.4, 3.5, 3.6, 3.7 do not support a 'UR' pref
# combined, PY-32321
b = <warning descr="Python version 3.4, 3.5, 3.6, 3.7 do not allow to mix bytes and non-bytes literals">u"" b""</warning>
b = <warning descr="Python version 3.4, 3.5, 3.6, 3.7 do not allow to mix bytes and non-bytes literals">r"" b""</warning>
b = <warning descr="Python version 3.4, 3.5, 3.6, 3.7 do not allow to mix bytes and non-bytes literals"><error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 2.6, 2.7, 3.4, 3.5 do not support a 'F' prefix">f</warning></error>"" b""</warning>
b = <warning descr="Python version 3.4, 3.5, 3.6, 3.7 do not allow to mix bytes and non-bytes literals"><error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 2.6, 3.4, 3.5 do not support a 'F' prefix">f</warning></error>"" b""</warning>
# never was available
a = <error descr="Python version 2.7 does not support a 'RR' prefix"><warning descr="Python version 2.6, 2.7, 3.4, 3.5, 3.6, 3.7 do not support a 'RR' prefix">rr</warning></error>""
a = <error descr="Python version 2.7 does not support a 'BB' prefix"><warning descr="Python version 2.6, 2.7, 3.4, 3.5, 3.6, 3.7 do not support a 'BB' prefix">bb</warning></error>""
a = <error descr="Python version 2.7 does not support a 'UU' prefix"><warning descr="Python version 2.6, 2.7, 3.4, 3.5, 3.6, 3.7 do not support a 'UU' prefix">uu</warning></error>""
\ No newline at end of file
a = <error descr="Python version 2.7 does not support a 'RR' prefix"><warning descr="Python version 2.6, 3.4, 3.5, 3.6, 3.7 do not support a 'RR' prefix">rr</warning></error>""
a = <error descr="Python version 2.7 does not support a 'BB' prefix"><warning descr="Python version 2.6, 3.4, 3.5, 3.6, 3.7 do not support a 'BB' prefix">bb</warning></error>""
a = <error descr="Python version 2.7 does not support a 'UU' prefix"><warning descr="Python version 2.6, 3.4, 3.5, 3.6, 3.7 do not support a 'UU' prefix">uu</warning></error>""
\ No newline at end of file
......@@ -2,5 +2,5 @@ def foo(*args, **kwargs):
print(args, kwargs)
foo(1, 2, 3, *[3]<error descr="Python versions < 3.5 do not allow a trailing comma after *expression"><warning descr="Python versions < 3.5 do not allow a trailing comma after *expression">,</warning></error>)
foo(1, 2, 3, *[3], **{'d': 'd'}<error descr="Python versions < 3.5 do not allow a trailing comma after **expression"><warning descr="Python versions < 3.5 do not allow a trailing comma after **expression">,</warning></error>)
foo(1, 2, 3, *[3]<error descr="Python version 3.4 does not allow a trailing comma after *expression"><warning descr="Python version 2.6, 2.7 do not allow a trailing comma after *expression">,</warning></error>)
foo(1, 2, 3, *[3], **{'d': 'd'}<error descr="Python version 3.4 does not allow a trailing comma after **expression"><warning descr="Python version 2.6, 2.7 do not allow a trailing comma after **expression">,</warning></error>)
try:
raise ValueError
finally:
<error descr="Python version 2.7 does not support this syntax. Raise with no arguments can only be used in an except block"><warning descr="Python version 2.6, 2.7 do not support this syntax. Raise with no arguments can only be used in an except block">raise</warning></error>
\ No newline at end of file
<error descr="Python version 2.7 does not support this syntax. Raise with no arguments can only be used in an except block"><warning descr="Python version 2.6 does not support this syntax. Raise with no arguments can only be used in an except block">raise</warning></error>
\ No newline at end of file
......@@ -3,7 +3,7 @@
# oct
<warning descr="Python version 2.6, 2.7, 3.4, 3.5 do not support underscores in numeric literals">0o1_23</warning>
<error descr="Python version 3.6 does not support this syntax. It requires '0o' prefix for octal literals"><warning descr="Python version 2.6, 2.7, 3.4, 3.5 do not support underscores in numeric literals"><warning descr="Python version 3.4, 3.5, 3.6, 3.7 do not support this syntax. It requires '0o' prefix for octal literals">01_23</warning></warning></error>
<error descr="Python version 3.6 does not support this syntax. It requires '0o' prefix for octal literals"><warning descr="Python version 2.6, 2.7, 3.4, 3.5 do not support underscores in numeric literals"><warning descr="Python version 3.4, 3.5, 3.7 do not support this syntax. It requires '0o' prefix for octal literals">01_23</warning></warning></error>
# bin
<warning descr="Python version 2.6, 2.7, 3.4, 3.5 do not support underscores in numeric literals">0b_0011_1111_0100_1110</warning>
......
class <warning descr="'async' and 'await' are keywords in Python 3.7 and newer">async</warning>(object):
class <warning descr="Python version 3.7 does not allow 'async' and 'await' as names">async</warning>(object):
pass
class <warning descr="'async' and 'await' are keywords in Python 3.7 and newer">await</warning>(object):
class <warning descr="Python version 3.7 does not allow 'async' and 'await' as names">await</warning>(object):
pass
def <warning descr="'async' and 'await' are keywords in Python 3.7 and newer">async</warning>():
def <warning descr="Python version 3.7 does not allow 'async' and 'await' as names">async</warning>():
pass
def <warning descr="'async' and 'await' are keywords in Python 3.7 and newer">await</warning>():
def <warning descr="Python version 3.7 does not allow 'async' and 'await' as names">await</warning>():
pass
<warning descr="'async' and 'await' are keywords in Python 3.7 and newer">async</warning> = 1
<warning descr="'async' and 'await' are keywords in Python 3.7 and newer">await</warning> = 2
\ No newline at end of file
<warning descr="Python version 3.7 does not allow 'async' and 'await' as names">async</warning> = 1
<warning descr="Python version 3.7 does not allow 'async' and 'await' as names">await</warning> = 2
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment