Deprecate Python 2.4 language level. Remove its usages.

This commit is contained in:
Semyon Proshev
2017-12-13 19:44:28 +03:00
parent f26862dee2
commit 556cb4fd3d
36 changed files with 103 additions and 329 deletions
@@ -30,6 +30,11 @@ import java.util.stream.Stream;
* @author yole
*/
public enum LanguageLevel {
/**
* @deprecated This level will be removed in 2018.2.
*/
@Deprecated
PYTHON24(24, false, true, false, false),
PYTHON25(25, false, true, false, false),
PYTHON26(26, true, true, false, false),
@@ -42,9 +47,13 @@ public enum LanguageLevel {
PYTHON35(35, true, false, true, true),
PYTHON36(36, true, false, true, true);
/**
* @deprecated This field will be removed in 2018.2.
*/
@Deprecated
public static final List<LanguageLevel> ALL_LEVELS = ImmutableList.copyOf(values());
public static final List<LanguageLevel> SUPPORTED_LEVELS = ImmutableList.copyOf(Stream.of(values()).filter(v -> v.myVersion >= 26).collect(
public static final List<LanguageLevel> SUPPORTED_LEVELS = ImmutableList.copyOf(Stream.of(values()).filter(v -> v.myVersion >= 25).collect(
Collectors.toList())); // Python versions 2.4 and 2.5 aren't supported anymore
private static final LanguageLevel DEFAULT2 = PYTHON27;
@@ -109,9 +118,6 @@ public enum LanguageLevel {
public static LanguageLevel fromPythonVersion(@NotNull String pythonVersion) {
if (pythonVersion.startsWith("2")) {
if (pythonVersion.startsWith("2.4")) {
return PYTHON24;
}
if (pythonVersion.startsWith("2.5")) {
return PYTHON25;
}
@@ -1,7 +0,0 @@
<html>
<body>
This inspection detects attempts to raise a new-style class as an exception in projects with
language level less than 2.5. Raising new-style classes is only supported in Python 2.5
or later.
</body>
</html>
@@ -365,7 +365,6 @@
<localInspection language="Python" shortName="PyClassicStyleClassInspection" suppressId="PyClassicStyleClass" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.classic.class.usage" groupKey="INSP.GROUP.python" enabledByDefault="false" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyClassicStyleClassInspection"/>
<localInspection language="Python" shortName="PyExceptionInheritInspection" suppressId="PyExceptionInherit" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.exception.not.inherit" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyExceptionInheritInspection"/>
<localInspection language="Python" shortName="PyDefaultArgumentInspection" suppressId="PyDefaultArgument" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.default.argument" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyDefaultArgumentInspection"/>
<localInspection language="Python" shortName="PyRaisingNewStyleClassInspection" suppressId="PyRaisingNewStyleClass" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.raising.new.style.class" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyRaisingNewStyleClassInspection"/>
<localInspection language="Python" shortName="PyIncorrectDocstringInspection" suppressId="PyIncorrectDocstring" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.incorrect.docstring" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyIncorrectDocstringInspection"/>
<localInspection language="Python" shortName="PyMissingOrEmptyDocstringInspection" suppressId="PyMissingOrEmptyDocstring" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.missing.or.empty.docstring" groupKey="INSP.GROUP.python" enabledByDefault="false" level="WEAK WARNING" implementationClass="com.jetbrains.python.inspections.PyMissingOrEmptyDocstringInspection"/>
<localInspection language="Python" shortName="PyUnboundLocalVariableInspection" suppressId="PyUnboundLocalVariable" bundle="com.jetbrains.python.PyBundle" key="INSP.NAME.unbound" groupKey="INSP.GROUP.python" enabledByDefault="true" level="WARNING" implementationClass="com.jetbrains.python.inspections.PyUnboundLocalVariableInspection"/>
@@ -447,9 +447,6 @@ INSP.NAME.exception.not.inherit=Exception doesn't inherit from standard ''Except
# PyDefaultArgumentInspection
INSP.NAME.default.argument=Default argument is mutable
# PyRaisingNewStyleClassInspection
INSP.NAME.raising.new.style.class=Raising a new style class
# PyIncorrectDocstringInspection
INSP.NAME.incorrect.docstring=Incorrect docstring
INSP.missing.parameter.in.docstring=Missing parameter {0} in docstring
@@ -1,75 +0,0 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jetbrains.python.inspections;
import com.intellij.codeInspection.LocalInspectionToolSession;
import com.intellij.codeInspection.ProblemsHolder;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.jetbrains.python.PyBundle;
import com.jetbrains.python.psi.*;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @author Alexey.Ivanov
*/
public class PyRaisingNewStyleClassInspection extends PyInspection {
@Nls
@NotNull
@Override
public String getDisplayName() {
return PyBundle.message("INSP.NAME.raising.new.style.class");
}
@NotNull
@Override
public PsiElementVisitor buildVisitor(@NotNull ProblemsHolder holder,
boolean isOnTheFly,
@NotNull LocalInspectionToolSession session) {
return new Visitor(holder, session);
}
private static class Visitor extends PyInspectionVisitor {
public Visitor(@Nullable ProblemsHolder holder, @NotNull LocalInspectionToolSession session) {
super(holder, session);
}
@Override
public void visitPyRaiseStatement(PyRaiseStatement node) {
if (LanguageLevel.forElement(node).isAtLeast(LanguageLevel.PYTHON25)) {
return;
}
final PyExpression[] expressions = node.getExpressions();
if (expressions.length == 0) {
return;
}
final PyExpression expression = expressions[0];
if (expression instanceof PyCallExpression) {
final PyExpression callee = ((PyCallExpression)expression).getCallee();
if (callee instanceof PyReferenceExpression) {
final PsiElement psiElement = ((PyReferenceExpression)callee).getReference(getResolveContext()).resolve();
if (psiElement instanceof PyClass) {
if (((PyClass)psiElement).isNewStyleClass(null)) {
registerProblem(expression, "Raising a new style class");
}
}
}
}
}
}
}
@@ -158,7 +158,7 @@ public final class PyExtractSuperclassHelper {
LOG.assertTrue(psiFile != null);
if (psiFile.getLastChild() != null) {
// TODO: make the number of newlines depend on style setting
psiFile.add(PyElementGenerator.getInstance(project).createFromText(LanguageLevel.PYTHON24, PsiWhiteSpace.class, "\n\n"));
psiFile.add(PyElementGenerator.getInstance(project).createFromText(LanguageLevel.PYTHON27, PsiWhiteSpace.class, "\n\n"));
}
newClass = (PyClass)psiFile.add(newClass);
PyClassRefactoringUtil.insertImport(clazz, Collections.singleton(newClass));
@@ -48,7 +48,7 @@ public final class PyToxTestLocator implements SMTestLocator {
@NotNull final String path,
@NotNull final Project project,
@NotNull final GlobalSearchScope scope) {
final PsiFile file = PyElementGenerator.getInstance(project).createDummyFile(LanguageLevel.PYTHON24, DUMMY_FILE_PADDING);
final PsiFile file = PyElementGenerator.getInstance(project).createDummyFile(LanguageLevel.PYTHON27, DUMMY_FILE_PADDING);
file.putUserData(ENV_NAME_KEY, path);
@SuppressWarnings("unchecked")
final List<Location> locations = Collections.singletonList(new PsiLocation(file));
@@ -48,7 +48,6 @@ public abstract class CompatibilityVisitor extends PyAnnotator {
protected List<LanguageLevel> myVersionsToProcess;
static {
AVAILABLE_PREFIXES.put(LanguageLevel.PYTHON24, Sets.newHashSet("R", "U", "UR"));
AVAILABLE_PREFIXES.put(LanguageLevel.PYTHON25, Sets.newHashSet("R", "U", "UR"));
AVAILABLE_PREFIXES.put(LanguageLevel.PYTHON26, Sets.newHashSet("R", "U", "UR", "B", "BR"));
AVAILABLE_PREFIXES.put(LanguageLevel.PYTHON27, Sets.newHashSet("R", "U", "UR", "B", "BR"));
@@ -297,11 +296,9 @@ public abstract class CompatibilityVisitor extends PyAnnotator {
public void visitPyWithStatement(PyWithStatement node) {
super.visitPyWithStatement(node);
registerOnFirstMatchingVersion(LanguageLevel.PYTHON24::equals, "Python version 2.4 doesn't support this syntax.", node);
final PyWithItem[] items = node.getWithItems();
if (items.length > 1) {
registerForAllMatchingVersions(level -> !level.supportsSetLiterals() && !level.equals(LanguageLevel.PYTHON24),
registerForAllMatchingVersions(level -> !level.supportsSetLiterals(),
" not support multiple context managers",
Arrays.asList(items).subList(1, items.length),
null);
@@ -316,16 +313,6 @@ public abstract class CompatibilityVisitor extends PyAnnotator {
checkAsyncKeyword(node);
}
@Override
public void visitPyClass(PyClass node) { // PY-2719
super.visitPyClass(node);
final PyArgumentList list = node.getSuperClassExpressionList();
if (list != null && list.getArguments().length == 0) {
registerOnFirstMatchingVersion(LanguageLevel.PYTHON24::equals, "Python version 2.4 does not support this syntax.", list);
}
}
@Override
public void visitPyPrintStatement(PyPrintStatement node) {
super.visitPyPrintStatement(node);
@@ -343,65 +330,6 @@ public abstract class CompatibilityVisitor extends PyAnnotator {
}
}
@Override
public void visitPyFromImportStatement(PyFromImportStatement node) {
super.visitPyFromImportStatement(node);
final PyReferenceExpression importSource = node.getImportSource();
if (importSource != null) {
final PsiElement prev = importSource.getPrevSibling();
if (prev != null && prev.getNode().getElementType() == PyTokenTypes.DOT) { // PY-2793
registerOnFirstMatchingVersion(LanguageLevel.PYTHON24::equals, "Python version 2.4 doesn't support this syntax.", node);
}
}
else {
registerOnFirstMatchingVersion(LanguageLevel.PYTHON24::equals, "Python version 2.4 doesn't support this syntax.", node);
}
}
@Override
public void visitPyAssignmentStatement(PyAssignmentStatement node) {
super.visitPyAssignmentStatement(node);
if (myVersionsToProcess.contains(LanguageLevel.PYTHON24)) {
PyExpression assignedValue = node.getAssignedValue();
Stack<PsiElement> st = new Stack<>(); // PY-2796
if (assignedValue != null)
st.push(assignedValue);
while (!st.isEmpty()) {
PsiElement el = st.pop();
if (el instanceof PyYieldExpression)
registerProblem(node, "Python version 2.4 doesn't support this syntax. " +
"In Python <= 2.4, yield was a statement; it didn't return any value.");
else {
for (PsiElement e : el.getChildren())
st.push(e);
}
}
}
}
@Override
public void visitPyConditionalExpression(PyConditionalExpression node) { //PY-4293
super.visitPyConditionalExpression(node);
registerOnFirstMatchingVersion(LanguageLevel.PYTHON24::equals, "Python version 2.4 doesn't support this syntax.", node);
}
@Override
public void visitPyTryExceptStatement(PyTryExceptStatement node) { // PY-2795
super.visitPyTryExceptStatement(node);
final PyExceptPart[] excepts = node.getExceptParts();
final PyFinallyPart finallyPart = node.getFinallyPart();
if (excepts.length != 0 && finallyPart != null) {
registerOnFirstMatchingVersion(LanguageLevel.PYTHON24::equals,
"Python version 2.4 doesn't support this syntax. You could use a finally block to ensure " +
"that code is always executed, or one or more except blocks to catch specific exceptions.",
node);
}
}
@Override
public void visitPyCallExpression(PyCallExpression node) {
super.visitPyCallExpression(node);
@@ -36,7 +36,7 @@ public class UnsupportedFeaturesUtil {
Logger log = Logger.getInstance(UnsupportedFeaturesUtil.class.getName());
log.error("Cannot find \"versions.xml\". " + e.getMessage());
}
for (LanguageLevel level : LanguageLevel.ALL_LEVELS) {
for (LanguageLevel level : LanguageLevel.SUPPORTED_LEVELS) {
ALL_LANGUAGE_LEVELS.add(level.toString());
}
}
@@ -1 +1 @@
var = <warning descr="Python version 2.4, 2.5, 2.6, 3.0 do not support dictionary comprehensions">{k: v for k, v in zip('abc', <caret>range(3)) if k % 2}</warning>
var = <warning descr="Python version 2.5, 2.6, 3.0 do not support dictionary comprehensions">{k: v for k, v in zip('abc', <caret>range(3)) if k % 2}</warning>
@@ -1,5 +0,0 @@
# PY-2792
x = <warning descr="Python version 2.4 doesn't support this syntax.">True if condition else False</warning>
def foo(): # PY-2796
<warning descr="Python version 2.4 doesn't support this syntax. In Python <= 2.4, yield was a statement; it didn't return any value.">a = (yield 1)</warning>
@@ -1,7 +1,7 @@
<warning descr="Python versions < 3.5 do not support this syntax">async</warning> def foo(x):
<warning descr="Python version 2.4 doesn't support this syntax."><warning descr="Python versions < 3.5 do not support this syntax">async</warning> with 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>
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:
pass
@@ -1,16 +1,16 @@
<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>
<warning descr="Python version 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>
<warning descr="Python version 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()
dataset = <warning descr="Python version 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()
dataset = <warning descr="Python version 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>
@@ -1,16 +1,16 @@
<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.4, 2.5, 2.6, 3.0 do 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.4, 2.5, 2.6, 3.0 do 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.5, 2.6, 3.0 do 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.5, 2.6, 3.0 do 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 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.4, 2.5, 2.6, 3.0 do 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.4, 2.5, 2.6, 3.0 do 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.5, 2.6, 3.0 do 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.5, 2.6, 3.0 do 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 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.4, 2.5, 2.6, 3.0 do 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.4, 2.5, 2.6, 3.0 do 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.5, 2.6, 3.0 do 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.5, 2.6, 3.0 do 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 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.4, 2.5, 2.6, 3.0 do 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.4, 2.5, 2.6, 3.0 do 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>
<warning descr="Python version 2.5, 2.6, 3.0 do 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.5, 2.6, 3.0 do 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>
@@ -1,10 +1,9 @@
class A(B):
def __init__(self):
<warning descr="Python version 2.4, 2.5, 2.6, 2.7 do not support this syntax. super() should have arguments in Python 2">super()</warning>
<warning descr="Python version 2.5, 2.6, 2.7 do not support this syntax. super() should have arguments in Python 2">super()</warning>
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have method cmp">cmp()</warning>
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have method reduce">reduce()</warning>
<warning descr="Python version 2.4 does not have method all">all()</warning>
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have method buffer">buffer()</warning>
@@ -1,9 +0,0 @@
# PY-4293
def test_conditional_expression(val):
x = <warning descr="Python version 2.4 doesn't support this syntax.">'Yes' if val else 'No'</warning>
return <warning descr="Python version 2.4 doesn't support this syntax.">'Yes' if val else 'No'</warning>
def f(arg):
pass
f(<warning descr="Python version 2.4 doesn't support this syntax.">1 if True else 2</warning>)
@@ -1 +1 @@
var = <warning descr="Python version 2.4, 2.5, 2.6, 3.0 do not support dictionary comprehensions">{i : chr(65+i) for i in range(4)}</warning>
var = <warning descr="Python version 2.5, 2.6, 3.0 do not support dictionary comprehensions">{i : chr(65+i) for i in range(4)}</warning>
@@ -1,8 +1,3 @@
<warning descr="Python version 2.4 doesn't support this syntax.">from . import smth</warning>
<warning descr="Python version 2.4 doesn't support this syntax.">from .module import name1, name2</warning>
from <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have module Bastion">Bastion</warning> import BastionClass
<warning descr="Python version 2.4 doesn't support this syntax.">from . import exceptions</warning>
from <warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have module email.Utils">email.Utils</warning> import formatdate
@@ -1,3 +1,3 @@
<error descr="Python version 2.7 does not have module builtins"><warning descr="Python version 2.4, 2.5, 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.5, 2.6, 2.7 do not have module builtins">import builtins</warning></error>
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have module __builtin__">import __builtin__</warning>
@@ -1,3 +0,0 @@
#PY-2719
class BaseC<warning descr="Python version 2.4 does not support this syntax.">()</warning>:
pass
@@ -1,2 +1,2 @@
<warning descr="Python version 2.4, 2.5, 2.6, 2.7 do not support this syntax.">raise exception from cause</warning>
<warning descr="Python version 2.5, 2.6, 2.7 do not support this syntax.">raise exception from cause</warning>
a = 1
@@ -1 +0,0 @@
<warning descr="Python version 2.4 doesn't support this syntax.">from ..exceptions import ServiceDoesNotExists</warning>
@@ -1 +1 @@
var = <warning descr="Python version 2.4, 2.5, 2.6, 3.0 do not support set comprehensions">{i for i in range(2)}</warning>
var = <warning descr="Python version 2.5, 2.6, 3.0 do not support set comprehensions">{i for i in range(2)}</warning>
@@ -1 +1 @@
var = <warning descr="Python version 2.4, 2.5, 2.6, 3.0 do not support set literal expressions">{1, 2}</warning>
var = <warning descr="Python version 2.5, 2.6, 3.0 do not support set literal expressions">{1, 2}</warning>
@@ -2,42 +2,42 @@ a = <warning descr="Python version 3.0, 3.1, 3.2 do not support a 'U' prefix">u<
# Python 3.6
a = <error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 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.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 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.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 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.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 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.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 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.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 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.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 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.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 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.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 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.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 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.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 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.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 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.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 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.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 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.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 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.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 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.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 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.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'UFR' prefix">ufr</warning></error>""
# python 3.3
a = <warning descr="Python version 3.0, 3.1, 3.2 do not support a 'U' prefix">u</warning>""
a = r""
a = <warning descr="Python version 2.4, 2.5 do not support a 'B' prefix">b</warning>""
a = <error descr="Python version 2.7 does not support a 'RB' prefix"><warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2 do not support a 'RB' prefix">rb</warning></error>""
a = <warning descr="Python version 2.4, 2.5, 3.0 do not support a 'BR' prefix">br</warning>""
a = <warning descr="Python version 2.5 does not support a 'B' prefix">b</warning>""
a = <error descr="Python version 2.7 does not support a 'RB' prefix"><warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2 do not support a 'RB' prefix">rb</warning></error>""
a = <warning descr="Python version 2.5, 3.0 do not support a 'BR' prefix">br</warning>""
# python 3.2, 3.1
a = r""
a = <warning descr="Python version 2.4, 2.5 do not support a 'B' prefix">b</warning>""
a = <warning descr="Python version 2.4, 2.5, 3.0 do not support a 'BR' prefix">br</warning>""
a = <warning descr="Python version 2.5 does not support a 'B' prefix">b</warning>""
a = <warning descr="Python version 2.5, 3.0 do not support a 'BR' prefix">br</warning>""
# python 3.0
a = r""
a = <warning descr="Python version 2.4, 2.5 do not support a 'B' prefix">b</warning>""
a = <warning descr="Python version 2.5 does not support a 'B' prefix">b</warning>""
# python 2.7, 2.6
a = <warning descr="Python version 3.0, 3.1, 3.2 do not support a 'U' prefix">u</warning>""
a = r""
a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'UR' prefix">ur</warning>""
a = <warning descr="Python version 2.4, 2.5 do not support a 'B' prefix">b</warning>""
a = <warning descr="Python version 2.4, 2.5, 3.0 do not support a 'BR' prefix">br</warning>""
a = <warning descr="Python version 2.5 does not support a 'B' prefix">b</warning>""
a = <warning descr="Python version 2.5, 3.0 do not support a 'BR' prefix">br</warning>""
# python 2.5
@@ -46,9 +46,9 @@ a = r""
a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'UR' prefix">ur</warning>""
# combined
b = <warning descr="Python version 3.0, 3.1, 3.2 do not support a 'U' prefix">u</warning>"" <warning descr="Python version 2.4, 2.5 do not support a 'B' prefix">b</warning>""
b = <warning descr="Python version 3.0, 3.1, 3.2 do not support a 'U' prefix">u</warning>"" <warning descr="Python version 2.5 does not support a 'B' prefix">b</warning>""
# never was available
a = <error descr="Python version 2.7 does not support a 'RR' prefix"><warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 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.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 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.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'UU' prefix">uu</warning></error>""
a = <error descr="Python version 2.7 does not support a 'RR' prefix"><warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 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.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 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.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'UU' prefix">uu</warning></error>""
@@ -1,8 +0,0 @@
<warning descr="Python version 2.4 doesn't support this syntax. You could use a finally block to ensure that code is always executed, or one or more except blocks to catch specific exceptions.">try:
do_smth()
except ImportError:
do()
except KeyError:
do_1()
finally:
quit()</warning>
@@ -1,4 +1,4 @@
try:
raise ValueError
finally:
<warning descr="Python version 2.4, 2.5, 2.6, 2.7 do not support this syntax. Raise with no arguments can only be used in an except block"><warning descr="Python version 2.7 does not support this syntax. Raise with no arguments can only be used in an except block">raise</warning></warning>
<warning descr="Python version 2.5, 2.6, 2.7 do not support this syntax. Raise with no arguments can only be used in an except block"><warning descr="Python version 2.7 does not support this syntax. Raise with no arguments can only be used in an except block">raise</warning></warning>
@@ -1,4 +1,4 @@
try:
raise ValueError
finally:
<warning descr="Python version 2.4, 2.5, 2.6, 2.7 do not support this syntax. Raise with no arguments can only be used in an except block">raise</warning>
<warning descr="Python version 2.5, 2.6, 2.7 do not support this syntax. Raise with no arguments can only be used in an except block">raise</warning>
@@ -1 +1 @@
import <warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2 do not have module _bz2">_bz2</warning>
import <warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2 do not have module _bz2">_bz2</warning>
@@ -1,58 +1,58 @@
# hex
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">0xCAFE_F00D</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">0xCAFE_F00D</warning>
# oct
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 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.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals"><warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support this syntax. It requires '0o' prefix for octal literals">01_23</warning></warning></error>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 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.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals"><warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support this syntax. It requires '0o' prefix for octal literals">01_23</warning></warning></error>
# bin
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">0b_0011_1111_0100_1110</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">0b_0011_1111_0100_1110</warning>
# dec
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_000_000</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_000_000</warning>
# pointfloat
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.</warning>
# exponentfloat
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23e1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23E1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.e1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.E1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23e1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23E1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.e1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.E1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23e+1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23E+1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.e+1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.E+1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23e+1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23E+1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.e+1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.E+1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23e-1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23E-1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.e-1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.E-1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23e-1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23E-1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.e-1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.E-1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_0000_23e1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_0000_23E1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00e1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00E1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_0000_23e1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_0000_23E1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00e1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00E1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_0000_23e+1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_0000_23E+1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00e+1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00E+1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_0000_23e+1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_0000_23E+1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00e+1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00E+1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_0000_23e-1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_0000_23E-1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00e-1_2</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00E-1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_0000_23e-1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_0000_23E-1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00e-1_2</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00E-1_2</warning>
# imag
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23j</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23J</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23j</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23J</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23e1_2j</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23e1_2J</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23e1_2j</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_00.00_23e1_2J</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_000_000j</warning>
<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_000_000J</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_000_000j</warning>
<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">10_000_000J</warning>
@@ -1,8 +1,8 @@
class C:
x<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: int</warning>
y<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: None</warning> = 42
x<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: int</warning>
y<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: None</warning> = 42
def m(self, d):
x<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: List[bool]</warning>
d['foo']<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: str</warning>
(d['bar'])<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: float</warning>
x<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: List[bool]</warning>
d['foo']<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: str</warning>
(d['bar'])<warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: float</warning>
@@ -1,2 +1,2 @@
<warning descr="Python version 2.4 doesn't support this syntax.">with A() as a, <warning descr="Python version 2.5, 2.6, 3.0 do not support multiple context managers">B() as b</warning>:
suite</warning>
with A() as a, <warning descr="Python version 2.5, 2.6, 3.0 do not support multiple context managers">B() as b</warning>:
suite
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>test.py</file>
<line>7</line>
<description>Raising a new style class</description>
</problem>
</problems>
@@ -1,8 +0,0 @@
class C(object):
pass
class D:
pass
raise C()
raise D()
@@ -85,11 +85,6 @@ public class PythonInspectionsTest extends PyTestCase {
doTest(getTestName(false), inspection);
}
public void testPyRaisingNewStyleClassInspection() {
LocalInspectionTool inspection = new PyRaisingNewStyleClassInspection();
doTestWithLanguageLevel(getTestName(false), inspection, LanguageLevel.PYTHON24);
}
public void testPyDocstringInspection() {
LocalInspectionTool inspection = new PyMissingOrEmptyDocstringInspection();
doTest(getTestName(false), inspection);
@@ -70,10 +70,6 @@ public class PyCompatibilityInspectionTest extends PyInspectionTestCase {
doTest(LanguageLevel.PYTHON27);
}
public void testPyClass() {
doTest();
}
public void testPrintStatement() {
doTest();
}
@@ -82,14 +78,6 @@ public class PyCompatibilityInspectionTest extends PyInspectionTestCase {
doTest();
}
public void testAssignmentStatement() {
doTest();
}
public void testTryExceptStatement() {
doTest();
}
public void testImportElement() {
doTest();
}
@@ -102,10 +90,6 @@ public class PyCompatibilityInspectionTest extends PyInspectionTestCase {
doTest();
}
public void testConditionalExpression() {
doTest();
}
public void testClassBaseList() {
doTest();
}
@@ -120,11 +104,6 @@ public class PyCompatibilityInspectionTest extends PyInspectionTestCase {
doTest(LanguageLevel.PYTHON33);
}
// PY-11047
public void testRelativeImport() {
doTest();
}
// PY-15390
public void testMatMul() {
doTest(LanguageLevel.PYTHON35);