mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Deprecate Python 2.5 language level. Remove its usages.
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -36,6 +36,10 @@ public enum LanguageLevel {
|
||||
*/
|
||||
@Deprecated
|
||||
PYTHON24(24, false, true, false, false),
|
||||
/**
|
||||
* @deprecated This level will be removed in 2018.2.
|
||||
*/
|
||||
@Deprecated
|
||||
PYTHON25(25, false, true, false, false),
|
||||
PYTHON26(26, true, true, false, false),
|
||||
PYTHON27(27, true, true, true, false),
|
||||
@@ -53,7 +57,7 @@ public enum LanguageLevel {
|
||||
@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 >= 25).collect(
|
||||
public static final List<LanguageLevel> SUPPORTED_LEVELS = ImmutableList.copyOf(Stream.of(values()).filter(v -> v.myVersion >= 26).collect(
|
||||
Collectors.toList())); // Python versions 2.4 and 2.5 aren't supported anymore
|
||||
|
||||
private static final LanguageLevel DEFAULT2 = PYTHON27;
|
||||
@@ -118,9 +122,6 @@ public enum LanguageLevel {
|
||||
|
||||
public static LanguageLevel fromPythonVersion(@NotNull String pythonVersion) {
|
||||
if (pythonVersion.startsWith("2")) {
|
||||
if (pythonVersion.startsWith("2.5")) {
|
||||
return PYTHON25;
|
||||
}
|
||||
if (pythonVersion.startsWith("2.6")) {
|
||||
return PYTHON26;
|
||||
}
|
||||
|
||||
@@ -87,8 +87,6 @@ QFIX.NAME.unresolved.reference.create.function=Create function ''{0}''
|
||||
|
||||
QFIX.introduce.variable=Introduce variable for statement
|
||||
|
||||
QFIX.unresolved.reference.add.future=Add 'from __future__ import with_statement''
|
||||
|
||||
# RemoveUnnecessaryBackslashQuickFix
|
||||
QFIX.remove.unnecessary.backslash=Remove unnecessary backslash in expression
|
||||
|
||||
|
||||
+1
-6
@@ -242,12 +242,7 @@ public class ConvertFormatOperatorToMethodIntention extends PyBaseIntentionActio
|
||||
if (binaryExpression == null) {
|
||||
return false;
|
||||
}
|
||||
final LanguageLevel languageLevel = LanguageLevel.forElement(binaryExpression);
|
||||
if (languageLevel.isOlderThan(LanguageLevel.PYTHON26)) {
|
||||
return false;
|
||||
}
|
||||
if (binaryExpression.getLeftExpression() instanceof PyStringLiteralExpression
|
||||
&& binaryExpression.getOperator() == PyTokenTypes.PERC) {
|
||||
if (binaryExpression.getLeftExpression() instanceof PyStringLiteralExpression && binaryExpression.getOperator() == PyTokenTypes.PERC) {
|
||||
final PyStringLiteralExpression str = (PyStringLiteralExpression)binaryExpression.getLeftExpression();
|
||||
if ((str.getText().length() > 0 && Character.toUpperCase(str.getText().charAt(0)) == 'B')) {
|
||||
return false;
|
||||
|
||||
-1
@@ -50,7 +50,6 @@ public class PyConvertMethodToPropertyIntention extends PyBaseIntentionAction {
|
||||
if (!(file instanceof PyFile)) {
|
||||
return false;
|
||||
}
|
||||
if (!LanguageLevel.forElement(file).isAtLeast(LanguageLevel.PYTHON26)) return false;
|
||||
final PsiElement element = PyUtil.findNonWhitespaceAtOffset(file, editor.getCaretModel().getOffset());
|
||||
final PyFunction function = PsiTreeUtil.getParentOfType(element, PyFunction.class);
|
||||
if (function == null) return false;
|
||||
|
||||
@@ -238,21 +238,6 @@ public class PyCompatibilityInspection extends PyInspection {
|
||||
}
|
||||
}
|
||||
|
||||
final PyFromImportStatement fromImportStatement = PsiTreeUtil.getParentOfType(importElement, PyFromImportStatement.class);
|
||||
if (fromImportStatement != null) {
|
||||
final QualifiedName qName = importElement.getImportedQName();
|
||||
final QualifiedName sourceQName = fromImportStatement.getImportSourceQName();
|
||||
|
||||
if (qName != null && sourceQName != null && qName.matches("unicode_literals") && sourceQName.matches("__future__")) {
|
||||
registerForAllMatchingVersions(level -> level.isOlderThan(LanguageLevel.PYTHON26),
|
||||
" not have unicode_literals in __future__ module",
|
||||
importElement,
|
||||
null);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
final QualifiedName qName = importElement.getImportedQName();
|
||||
if (qName != null && !qName.matches("builtins") && !qName.matches("__builtin__")) {
|
||||
final String moduleName = qName.toString();
|
||||
|
||||
@@ -185,34 +185,32 @@ public class PyPropertyDefinitionInspection extends PyInspection {
|
||||
@Override
|
||||
public void visitPyFunction(PyFunction node) {
|
||||
super.visitPyFunction(node);
|
||||
if (myLevel.isAtLeast(LanguageLevel.PYTHON26)) {
|
||||
// check @foo.setter and @foo.deleter
|
||||
PyClass cls = node.getContainingClass();
|
||||
if (cls != null) {
|
||||
final PyDecoratorList decos = node.getDecoratorList();
|
||||
if (decos != null) {
|
||||
String name = node.getName();
|
||||
for (PyDecorator deco : decos.getDecorators()) {
|
||||
final QualifiedName qName = deco.getQualifiedName();
|
||||
if (qName != null) {
|
||||
List<String> nameParts = qName.getComponents();
|
||||
if (nameParts.size() == 2) {
|
||||
final int suffixIndex = SUFFIXES.indexOf(nameParts.get(1));
|
||||
if (suffixIndex >= 0) {
|
||||
if (Comparing.equal(name, nameParts.get(0))) {
|
||||
// names are ok, what about signatures?
|
||||
PsiElement markable = getFunctionMarkingElement(node);
|
||||
if (suffixIndex == 0) {
|
||||
checkSetter(node, markable);
|
||||
}
|
||||
else {
|
||||
checkDeleter(node, markable);
|
||||
}
|
||||
// check @foo.setter and @foo.deleter
|
||||
PyClass cls = node.getContainingClass();
|
||||
if (cls != null) {
|
||||
final PyDecoratorList decos = node.getDecoratorList();
|
||||
if (decos != null) {
|
||||
String name = node.getName();
|
||||
for (PyDecorator deco : decos.getDecorators()) {
|
||||
final QualifiedName qName = deco.getQualifiedName();
|
||||
if (qName != null) {
|
||||
List<String> nameParts = qName.getComponents();
|
||||
if (nameParts.size() == 2) {
|
||||
final int suffixIndex = SUFFIXES.indexOf(nameParts.get(1));
|
||||
if (suffixIndex >= 0) {
|
||||
if (Comparing.equal(name, nameParts.get(0))) {
|
||||
// names are ok, what about signatures?
|
||||
PsiElement markable = getFunctionMarkingElement(node);
|
||||
if (suffixIndex == 0) {
|
||||
checkSetter(node, markable);
|
||||
}
|
||||
else {
|
||||
registerProblem(deco, PyBundle.message("INSP.func.property.name.mismatch"));
|
||||
checkDeleter(node, markable);
|
||||
}
|
||||
}
|
||||
else {
|
||||
registerProblem(deco, PyBundle.message("INSP.func.property.name.mismatch"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-48
@@ -1,48 +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.quickfix;
|
||||
|
||||
import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.jetbrains.python.PyBundle;
|
||||
import com.jetbrains.python.psi.LanguageLevel;
|
||||
import com.jetbrains.python.psi.PyElementGenerator;
|
||||
import com.jetbrains.python.psi.PyFile;
|
||||
import com.jetbrains.python.psi.PyFromImportStatement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* User: catherine
|
||||
*
|
||||
* QuickFix to add 'from __future__ import with_statement'' if python version is less than 2.6
|
||||
*/
|
||||
public class UnresolvedRefAddFutureImportQuickFix implements LocalQuickFix {
|
||||
@NotNull
|
||||
public String getFamilyName() {
|
||||
return PyBundle.message("QFIX.unresolved.reference.add.future");
|
||||
}
|
||||
|
||||
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
|
||||
PsiElement element = descriptor.getPsiElement();
|
||||
PyFile file = (PyFile)element.getContainingFile();
|
||||
PyElementGenerator elementGenerator = PyElementGenerator.getInstance(project);
|
||||
PyFromImportStatement statement = elementGenerator.createFromText(LanguageLevel.forElement(element), PyFromImportStatement.class,
|
||||
"from __future__ import with_statement");
|
||||
file.addBefore(statement, file.getStatements().get(0));
|
||||
}
|
||||
}
|
||||
-5
@@ -508,11 +508,6 @@ public class PyUnresolvedReferencesInspection extends PyInspection {
|
||||
if (PyUnreachableCodeInspection.hasAnyInterruptedControlFlowPaths(expr)) {
|
||||
return;
|
||||
}
|
||||
if (LanguageLevel.forElement(node).isOlderThan(LanguageLevel.PYTHON26)) {
|
||||
if ("with".equals(refName)) {
|
||||
actions.add(new UnresolvedRefAddFutureImportQuickFix());
|
||||
}
|
||||
}
|
||||
if (refText.equals("true") || refText.equals("false")) {
|
||||
actions.add(new UnresolvedRefTrueFalseQuickFix(element));
|
||||
}
|
||||
|
||||
@@ -45,10 +45,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
* @author vlan
|
||||
*/
|
||||
public class PyPackageManagerImpl extends PyPackageManager {
|
||||
// Python 2.4-2.5 compatible versions
|
||||
private static final String SETUPTOOLS_PRE_26_VERSION = "1.4.2";
|
||||
private static final String PIP_PRE_26_VERSION = "1.1";
|
||||
private static final String VIRTUALENV_PRE_26_VERSION = "1.7.2";
|
||||
|
||||
private static final String SETUPTOOLS_VERSION = "28.8.0";
|
||||
private static final String PIP_VERSION = "9.0.1";
|
||||
@@ -88,15 +84,11 @@ public class PyPackageManagerImpl extends PyPackageManager {
|
||||
|
||||
@Override
|
||||
public void installManagement() throws ExecutionException {
|
||||
final Sdk sdk = getSdk();
|
||||
final boolean pre26 = PythonSdkType.getLanguageLevelForSdk(sdk).isOlderThan(LanguageLevel.PYTHON26);
|
||||
if (!refreshAndCheckForSetuptools()) {
|
||||
final String name = PyPackageUtil.SETUPTOOLS + "-" + (pre26 ? SETUPTOOLS_PRE_26_VERSION : SETUPTOOLS_VERSION);
|
||||
installManagement(name);
|
||||
installManagement(PyPackageUtil.SETUPTOOLS + "-" + SETUPTOOLS_VERSION);
|
||||
}
|
||||
if (PyPackageUtil.findPackage(refreshAndGetPackages(false), PyPackageUtil.PIP) == null) {
|
||||
final String name = PyPackageUtil.PIP + "-" + (pre26 ? PIP_PRE_26_VERSION : PIP_VERSION);
|
||||
installManagement(name);
|
||||
installManagement(PyPackageUtil.PIP + "-" + PIP_VERSION);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,8 +306,7 @@ public class PyPackageManagerImpl extends PyPackageManager {
|
||||
args.add("--system-site-packages");
|
||||
}
|
||||
args.add(destinationDir);
|
||||
final boolean pre26 = languageLevel.isOlderThan(LanguageLevel.PYTHON26);
|
||||
final String name = "virtualenv-" + (pre26 ? VIRTUALENV_PRE_26_VERSION : VIRTUALENV_VERSION);
|
||||
final String name = "virtualenv-" + VIRTUALENV_VERSION;
|
||||
final String dirName = extractHelper(name + ".tar.gz");
|
||||
try {
|
||||
final String fileName = dirName + name + File.separatorChar + "virtualenv.py";
|
||||
|
||||
@@ -641,13 +641,12 @@ public class PyClassImpl extends PyBaseElementImpl<PyClassStub> implements PyCla
|
||||
/**
|
||||
* @param name name of the property
|
||||
* @param property_filter returns true if the property is acceptable
|
||||
* @param advanced is @foo.setter syntax allowed
|
||||
* @return the first property that both filters accepted.
|
||||
*/
|
||||
@Nullable
|
||||
private Property processPropertiesInClass(@Nullable String name, @Nullable Processor<Property> property_filter, boolean advanced) {
|
||||
private Property processPropertiesInClass(@Nullable String name, @Nullable Processor<Property> property_filter) {
|
||||
// NOTE: fast enough to be rerun every time
|
||||
Property prop = processDecoratedProperties(name, property_filter, advanced);
|
||||
Property prop = processDecoratedProperties(name, property_filter);
|
||||
if (prop != null) return prop;
|
||||
if (getStub() != null) {
|
||||
prop = processStubProperties(name, property_filter);
|
||||
@@ -668,7 +667,7 @@ public class PyClassImpl extends PyBaseElementImpl<PyClassStub> implements PyCla
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private Property processDecoratedProperties(@Nullable String name, @Nullable Processor<Property> filter, boolean useAdvancedSyntax) {
|
||||
private Property processDecoratedProperties(@Nullable String name, @Nullable Processor<Property> filter) {
|
||||
// look at @property decorators
|
||||
Map<String, List<PyFunction>> grouped = new HashMap<>();
|
||||
// group suitable same-named methods, each group defines a property
|
||||
@@ -703,16 +702,14 @@ public class PyClassImpl extends PyBaseElementImpl<PyClassStub> implements PyCla
|
||||
}
|
||||
}
|
||||
if (PyNames.PROPERTY.equals(decoName) ||
|
||||
PyKnownDecoratorUtil.isPropertyDecorator(deco, TypeEvalContext.codeInsightFallback(getProject()))) {
|
||||
PyKnownDecoratorUtil.isPropertyDecorator(deco, TypeEvalContext.codeInsightFallback(getProject())) ||
|
||||
qname.matches(decoratorName, PyNames.GETTER)) {
|
||||
getter = new Maybe<>(method);
|
||||
}
|
||||
else if (useAdvancedSyntax && qname.matches(decoratorName, PyNames.GETTER)) {
|
||||
getter = new Maybe<>(method);
|
||||
}
|
||||
else if (useAdvancedSyntax && qname.matches(decoratorName, PyNames.SETTER)) {
|
||||
else if (qname.matches(decoratorName, PyNames.SETTER)) {
|
||||
setter = new Maybe<>(method);
|
||||
}
|
||||
else if (useAdvancedSyntax && qname.matches(decoratorName, PyNames.DELETER)) {
|
||||
else if (qname.matches(decoratorName, PyNames.DELETER)) {
|
||||
deleter = new Maybe<>(method);
|
||||
}
|
||||
}
|
||||
@@ -827,14 +824,7 @@ public class PyClassImpl extends PyBaseElementImpl<PyClassStub> implements PyCla
|
||||
@Nullable
|
||||
private Property processProperties(@Nullable String name, @Nullable Processor<Property> filter, boolean inherited) {
|
||||
PyPsiUtils.assertValid(this);
|
||||
LanguageLevel level = LanguageLevel.getDefault();
|
||||
// EA-32381: A tree-based instance may not have a parent element somehow, so getContainingFile() may be not appropriate
|
||||
final PsiFile file = getParentByStub() != null ? getContainingFile() : null;
|
||||
if (file != null) {
|
||||
level = LanguageLevel.forElement(file);
|
||||
}
|
||||
final boolean useAdvancedSyntax = level.isAtLeast(LanguageLevel.PYTHON26);
|
||||
final Property local = processPropertiesInClass(name, filter, useAdvancedSyntax);
|
||||
final Property local = processPropertiesInClass(name, filter);
|
||||
if (local != null) {
|
||||
return local;
|
||||
}
|
||||
@@ -843,7 +833,7 @@ public class PyClassImpl extends PyBaseElementImpl<PyClassStub> implements PyCla
|
||||
return null;
|
||||
}
|
||||
for (PyClass cls : getAncestorClasses(null)) {
|
||||
final Property property = ((PyClassImpl)cls).processPropertiesInClass(name, filter, useAdvancedSyntax);
|
||||
final Property property = ((PyClassImpl)cls).processPropertiesInClass(name, filter);
|
||||
if (property != null) {
|
||||
return property;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ public abstract class CompatibilityVisitor extends PyAnnotator {
|
||||
protected List<LanguageLevel> myVersionsToProcess;
|
||||
|
||||
static {
|
||||
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"));
|
||||
AVAILABLE_PREFIXES.put(LanguageLevel.PYTHON30, Sets.newHashSet("R", "B"));
|
||||
@@ -116,12 +115,6 @@ public abstract class CompatibilityVisitor extends PyAnnotator {
|
||||
element = element.getNextSibling();
|
||||
}
|
||||
|
||||
if (element != null && "as".equals(element.getText())) {
|
||||
registerOnFirstMatchingVersion(level -> level.isOlderThan(LanguageLevel.PYTHON26),
|
||||
"Python versions < 2.6 do not support this syntax.",
|
||||
node);
|
||||
}
|
||||
|
||||
if (element != null && ",".equals(element.getText())) {
|
||||
registerForAllMatchingVersions(LanguageLevel::isPy3K, " not support this syntax.", node, new ReplaceExceptPartQuickFix());
|
||||
}
|
||||
@@ -580,12 +573,6 @@ public abstract class CompatibilityVisitor extends PyAnnotator {
|
||||
if (keywordArgumentNames.contains(keyword)) {
|
||||
registerProblem(argument, "Keyword argument repeated", new PyRemoveArgumentQuickFix());
|
||||
}
|
||||
else if (seenPositionalContainer) {
|
||||
registerOnFirstMatchingVersion(level -> level.isOlderThan(LanguageLevel.PYTHON26),
|
||||
"Python versions < 2.6 do not allow keyword arguments after *expression",
|
||||
argument,
|
||||
new PyRemoveArgumentQuickFix());
|
||||
}
|
||||
else if (seenKeywordContainer) {
|
||||
registerOnFirstMatchingVersion(level -> level.isOlderThan(LanguageLevel.PYTHON35),
|
||||
"Python versions < 3.5 do not allow keyword arguments after **expression",
|
||||
|
||||
@@ -1 +1 @@
|
||||
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>
|
||||
var = <warning descr="Python version 2.6, 3.0 do not support dictionary comprehensions">{k: v for k, v in zip('abc', <caret>range(3)) if k % 2}</warning>
|
||||
+4
-4
@@ -7,11 +7,11 @@ foo(0,
|
||||
<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 versions < 2.6 do not allow keyword arguments after *expression">a='a'</warning>,
|
||||
a='a',
|
||||
<warning descr="Python versions < 3.5 do not allow duplicate *expressions">*[6]</warning>,
|
||||
<warning descr="Python versions < 2.6 do not allow keyword arguments after *expression">b='b'</warning>,
|
||||
b='b',
|
||||
<warning descr="Python versions < 3.5 do not allow duplicate *expressions">*[7]</warning>,
|
||||
<warning descr="Python versions < 2.6 do not allow keyword arguments after *expression">c='c'</warning>,
|
||||
c='c',
|
||||
**{'d': 'd'},
|
||||
<warning descr="Python versions < 2.6 do not allow keyword arguments after *expression">e='e'</warning>,
|
||||
<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>)
|
||||
|
||||
@@ -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.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.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.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.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.5, 2.6, 3.0 do not support set comprehensions">{data for line in gen()
|
||||
dataset = <warning descr="Python version 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.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.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.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 version 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.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.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 version 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.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.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 version 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.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.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>
|
||||
<warning descr="Python version 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.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,15 +1,8 @@
|
||||
class A(B):
|
||||
def __init__(self):
|
||||
<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 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 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have method buffer">buffer()</warning>
|
||||
|
||||
def foo(a,b,c):
|
||||
print (a,b,c)
|
||||
|
||||
args=['b']
|
||||
foo('a', c='c', *args) # OK
|
||||
foo('a', *args, <warning descr="Python versions < 2.6 do not allow keyword arguments after *expression">c='c'</warning>) # Not OK
|
||||
<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 +1 @@
|
||||
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>
|
||||
var = <warning descr="Python version 2.6, 3.0 do not support dictionary comprehensions">{i : chr(65+i) for i in range(4)}</warning>
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
try:
|
||||
do_smth()
|
||||
<warning descr="Python versions < 2.6 do not support this syntax.">except ImportError as e:
|
||||
do()</warning>
|
||||
|
||||
try:
|
||||
do_smth()
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support this syntax.">except ImportError, ImportWarning:
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
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
|
||||
|
||||
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
|
||||
from <warning descr="Python version 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.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.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,2 +1,2 @@
|
||||
<warning descr="Python version 2.5, 2.6, 2.7 do not support this syntax.">raise exception from cause</warning>
|
||||
<warning descr="Python version 2.6, 2.7 do not support this syntax.">raise exception from cause</warning>
|
||||
a = 1
|
||||
@@ -1 +1 @@
|
||||
var = <warning descr="Python version 2.5, 2.6, 3.0 do not support set comprehensions">{i for i in range(2)}</warning>
|
||||
var = <warning descr="Python version 2.6, 3.0 do not support set comprehensions">{i for i in range(2)}</warning>
|
||||
|
||||
@@ -1 +1 @@
|
||||
var = <warning descr="Python version 2.5, 2.6, 3.0 do not support set literal expressions">{1, 2}</warning>
|
||||
var = <warning descr="Python version 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.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>""
|
||||
a = <error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 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.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.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.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.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.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.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.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.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.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>""
|
||||
a = b""
|
||||
a = <error descr="Python version 2.7 does not support a 'RB' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2 do not support a 'RB' prefix">rb</warning></error>""
|
||||
a = <warning descr="Python version 3.0 does not support a 'BR' prefix">br</warning>""
|
||||
|
||||
# python 3.2, 3.1
|
||||
|
||||
a = r""
|
||||
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>""
|
||||
a = b""
|
||||
a = <warning descr="Python version 3.0 does not support a 'BR' prefix">br</warning>""
|
||||
|
||||
# python 3.0
|
||||
|
||||
a = r""
|
||||
a = <warning descr="Python version 2.5 does not support a 'B' prefix">b</warning>""
|
||||
a = b""
|
||||
|
||||
# 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.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>""
|
||||
a = b""
|
||||
a = <warning descr="Python version 3.0 does 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.5 does 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>"" b""
|
||||
|
||||
# never was available
|
||||
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>""
|
||||
a = <error descr="Python version 2.7 does not support a 'RR' prefix"><warning descr="Python version 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.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.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,4 +1,4 @@
|
||||
try:
|
||||
raise ValueError
|
||||
finally:
|
||||
<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>
|
||||
<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"><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.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.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.5, 2.6, 2.7, 3.0, 3.1, 3.2 do not have module _bz2">_bz2</warning>
|
||||
import <warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2 do not have module _bz2">_bz2</warning>
|
||||
+37
-37
@@ -1,58 +1,58 @@
|
||||
# hex
|
||||
<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>
|
||||
<warning descr="Python version 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.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>
|
||||
<warning descr="Python version 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.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.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.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.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.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.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>
|
||||
<warning descr="Python version 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.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.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.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.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.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.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_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.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.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.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.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.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.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.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.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_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.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.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.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.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_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.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.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.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.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.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.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.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.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.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.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.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_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.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.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_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.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.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.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
|
||||
x<warning descr="Python version 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.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.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>
|
||||
x<warning descr="Python version 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.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.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 @@
|
||||
with A() as a, <warning descr="Python version 2.5, 2.6, 3.0 do not support multiple context managers">B() as b</warning>:
|
||||
with A() as a, <warning descr="Python version 2.6, 3.0 do not support multiple context managers">B() as b</warning>:
|
||||
suite
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
class A(object):
|
||||
def __init__(self, bar):
|
||||
self._x = 1 ; self._bar = bar
|
||||
|
||||
def __getX(self):
|
||||
return self._x
|
||||
|
||||
def __setX(self, x):
|
||||
self._x = x
|
||||
|
||||
def __delX(self):
|
||||
pass
|
||||
|
||||
x1 = property(__getX, __setX, __delX, "doc of x1")
|
||||
x2 = property(<warning descr="Getter should return or yield something"><warning descr="Getter signature should be (self)">__setX</warning></warning>)
|
||||
x3 = property(__getX, <warning descr="Setter should not return a value"><warning descr="Setter signature should be (self, value)">__getX</warning></warning>)
|
||||
x4 = property(__getX, fdel=<warning descr="Deleter should not return a value">__getX</warning>)
|
||||
x5 = property(__getX, doc=<warning descr="The doc parameter should be a string">123</warning>)
|
||||
|
||||
x6 = property(lambda self: self._x)
|
||||
x7 = property(lambda self: self._x, <warning descr="Setter should not return a value"><warning descr="Setter signature should be (self, value)">lambda self: self._x</warning></warning>)
|
||||
|
||||
@property
|
||||
def foo(self):
|
||||
return self._x
|
||||
|
||||
@foo.setter # ignored in 2.5
|
||||
def foo(self, x):
|
||||
self._x = x
|
||||
|
||||
@foo.deleter # ignored in 2.5
|
||||
def foo(self):
|
||||
pass
|
||||
|
||||
@property
|
||||
def boo(self):
|
||||
return self._x
|
||||
|
||||
@boo.setter
|
||||
def boo1(self, x): # ignored in 2.5
|
||||
self._x = x
|
||||
|
||||
@boo.deleter
|
||||
def boo2(self): # ignored in 2,5
|
||||
pass
|
||||
|
||||
@property
|
||||
def <warning descr="Getter should return or yield something">moo</warning>(self):
|
||||
pass
|
||||
|
||||
@moo.setter
|
||||
def foo(self, x):
|
||||
return 1 # ignored in 2.5
|
||||
|
||||
@foo.deleter
|
||||
def foo(self):
|
||||
return self._x # ignored in 2.5
|
||||
|
||||
@qoo.setter # unknown qoo is reported in ref inspection
|
||||
def qoo(self, v):
|
||||
self._x = v
|
||||
|
||||
@property
|
||||
def bar(self):
|
||||
return None
|
||||
|
||||
class Ghostbusters(object):
|
||||
def __call__(self):
|
||||
return "Who do you call?"
|
||||
|
||||
gb = Ghostbusters()
|
||||
|
||||
class B(object):
|
||||
x = property(gb)
|
||||
y = property(Ghostbusters())
|
||||
z = property(Ghostbusters)
|
||||
|
||||
class Eternal(object):
|
||||
def give(self):
|
||||
while True:
|
||||
yield 1
|
||||
|
||||
def giveAndTake(self):
|
||||
x = 1
|
||||
while True:
|
||||
x = (yield x)
|
||||
|
||||
one = property(give)
|
||||
anything = property(giveAndTake)
|
||||
@@ -1,2 +0,0 @@
|
||||
<error descr="Unresolved reference 'with'">with</error><error descr="End of statement expected"> </error>open("x.txt")<error descr="End of statement expected"> </error><error descr="Unresolved reference 'as'">as</error><error descr="End of statement expected"> </error><error descr="Unresolved reference 'f'">f</error><error descr="End of statement expected">:</error><EOLError descr="Statement expected, found Py:COLON"></EOLError>
|
||||
<error descr="Unexpected indent">d</error>ata = <error descr="Unresolved reference 'f'">f</error>.read()
|
||||
@@ -1,4 +0,0 @@
|
||||
from __future__ import with_statement
|
||||
|
||||
with open("x.txt") as f:
|
||||
data = f.read()
|
||||
@@ -1,22 +0,0 @@
|
||||
# import A as B
|
||||
import A as B
|
||||
# import A as D, A as DDD
|
||||
import A as D, A as DDD
|
||||
# import A.B.C as D, A as DDD
|
||||
import A.B.C as D, A as DDD
|
||||
# import as as as
|
||||
import as as as
|
||||
# import A
|
||||
import A
|
||||
# import A, B, C
|
||||
import A, B, C
|
||||
# import A.B.C
|
||||
import A.B.C
|
||||
# from A import B, C
|
||||
from A import B, C
|
||||
# from A import B as C
|
||||
from A import B as C
|
||||
# from A import B as C, X as Y
|
||||
from A import B as C, X as Y
|
||||
# from foo import as as as
|
||||
from foo import as as as
|
||||
@@ -1,211 +0,0 @@
|
||||
PyFile:ImportStmt.py
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# import A as B')
|
||||
PsiWhiteSpace('\n')
|
||||
PyImportStatement
|
||||
PsiElement(Py:IMPORT_KEYWORD)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:A
|
||||
PyReferenceExpression: A
|
||||
PsiElement(Py:IDENTIFIER)('A')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:AS_KEYWORD)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PyTargetExpression: B
|
||||
PsiElement(Py:IDENTIFIER)('B')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# import A as D, A as DDD')
|
||||
PsiWhiteSpace('\n')
|
||||
PyImportStatement
|
||||
PsiElement(Py:IMPORT_KEYWORD)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:A
|
||||
PyReferenceExpression: A
|
||||
PsiElement(Py:IDENTIFIER)('A')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:AS_KEYWORD)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PyTargetExpression: D
|
||||
PsiElement(Py:IDENTIFIER)('D')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:A
|
||||
PyReferenceExpression: A
|
||||
PsiElement(Py:IDENTIFIER)('A')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:AS_KEYWORD)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PyTargetExpression: DDD
|
||||
PsiElement(Py:IDENTIFIER)('DDD')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# import A.B.C as D, A as DDD')
|
||||
PsiWhiteSpace('\n')
|
||||
PyImportStatement
|
||||
PsiElement(Py:IMPORT_KEYWORD)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:A.B.C
|
||||
PyReferenceExpression: C
|
||||
PyReferenceExpression: B
|
||||
PyReferenceExpression: A
|
||||
PsiElement(Py:IDENTIFIER)('A')
|
||||
PsiElement(Py:DOT)('.')
|
||||
PsiElement(Py:IDENTIFIER)('B')
|
||||
PsiElement(Py:DOT)('.')
|
||||
PsiElement(Py:IDENTIFIER)('C')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:AS_KEYWORD)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PyTargetExpression: D
|
||||
PsiElement(Py:IDENTIFIER)('D')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:A
|
||||
PyReferenceExpression: A
|
||||
PsiElement(Py:IDENTIFIER)('A')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:AS_KEYWORD)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PyTargetExpression: DDD
|
||||
PsiElement(Py:IDENTIFIER)('DDD')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# import as as as')
|
||||
PsiWhiteSpace('\n')
|
||||
PyImportStatement
|
||||
PsiElement(Py:IMPORT_KEYWORD)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:as
|
||||
PyReferenceExpression: as
|
||||
PsiElement(Py:IDENTIFIER)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:AS_KEYWORD)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PyTargetExpression: as
|
||||
PsiElement(Py:IDENTIFIER)('as')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# import A')
|
||||
PsiWhiteSpace('\n')
|
||||
PyImportStatement
|
||||
PsiElement(Py:IMPORT_KEYWORD)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:A
|
||||
PyReferenceExpression: A
|
||||
PsiElement(Py:IDENTIFIER)('A')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# import A, B, C')
|
||||
PsiWhiteSpace('\n')
|
||||
PyImportStatement
|
||||
PsiElement(Py:IMPORT_KEYWORD)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:A
|
||||
PyReferenceExpression: A
|
||||
PsiElement(Py:IDENTIFIER)('A')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:B
|
||||
PyReferenceExpression: B
|
||||
PsiElement(Py:IDENTIFIER)('B')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:C
|
||||
PyReferenceExpression: C
|
||||
PsiElement(Py:IDENTIFIER)('C')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# import A.B.C')
|
||||
PsiWhiteSpace('\n')
|
||||
PyImportStatement
|
||||
PsiElement(Py:IMPORT_KEYWORD)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:A.B.C
|
||||
PyReferenceExpression: C
|
||||
PyReferenceExpression: B
|
||||
PyReferenceExpression: A
|
||||
PsiElement(Py:IDENTIFIER)('A')
|
||||
PsiElement(Py:DOT)('.')
|
||||
PsiElement(Py:IDENTIFIER)('B')
|
||||
PsiElement(Py:DOT)('.')
|
||||
PsiElement(Py:IDENTIFIER)('C')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# from A import B, C')
|
||||
PsiWhiteSpace('\n')
|
||||
PyFromImportStatement
|
||||
PsiElement(Py:FROM_KEYWORD)('from')
|
||||
PsiWhiteSpace(' ')
|
||||
PyReferenceExpression: A
|
||||
PsiElement(Py:IDENTIFIER)('A')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IMPORT_KEYWORD)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:B
|
||||
PyReferenceExpression: B
|
||||
PsiElement(Py:IDENTIFIER)('B')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:C
|
||||
PyReferenceExpression: C
|
||||
PsiElement(Py:IDENTIFIER)('C')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# from A import B as C')
|
||||
PsiWhiteSpace('\n')
|
||||
PyFromImportStatement
|
||||
PsiElement(Py:FROM_KEYWORD)('from')
|
||||
PsiWhiteSpace(' ')
|
||||
PyReferenceExpression: A
|
||||
PsiElement(Py:IDENTIFIER)('A')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IMPORT_KEYWORD)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:B
|
||||
PyReferenceExpression: B
|
||||
PsiElement(Py:IDENTIFIER)('B')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:AS_KEYWORD)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PyTargetExpression: C
|
||||
PsiElement(Py:IDENTIFIER)('C')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# from A import B as C, X as Y')
|
||||
PsiWhiteSpace('\n')
|
||||
PyFromImportStatement
|
||||
PsiElement(Py:FROM_KEYWORD)('from')
|
||||
PsiWhiteSpace(' ')
|
||||
PyReferenceExpression: A
|
||||
PsiElement(Py:IDENTIFIER)('A')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IMPORT_KEYWORD)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:B
|
||||
PyReferenceExpression: B
|
||||
PsiElement(Py:IDENTIFIER)('B')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:AS_KEYWORD)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PyTargetExpression: C
|
||||
PsiElement(Py:IDENTIFIER)('C')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:X
|
||||
PyReferenceExpression: X
|
||||
PsiElement(Py:IDENTIFIER)('X')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:AS_KEYWORD)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PyTargetExpression: Y
|
||||
PsiElement(Py:IDENTIFIER)('Y')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# from foo import as as as')
|
||||
PsiWhiteSpace('\n')
|
||||
PyFromImportStatement
|
||||
PsiElement(Py:FROM_KEYWORD)('from')
|
||||
PsiWhiteSpace(' ')
|
||||
PyReferenceExpression: foo
|
||||
PsiElement(Py:IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IMPORT_KEYWORD)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:as
|
||||
PyReferenceExpression: as
|
||||
PsiElement(Py:IDENTIFIER)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:AS_KEYWORD)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PyTargetExpression: as
|
||||
PsiElement(Py:IDENTIFIER)('as')
|
||||
@@ -1,9 +0,0 @@
|
||||
# with = 1 # legal identifier
|
||||
# with = 1
|
||||
with = 1
|
||||
# from __future__ import nested_scopes, with_statement
|
||||
from __future__ import nested_scopes, with_statement
|
||||
# with x.y(z)[t] as y: pass
|
||||
with x.y(z)[t] as y: pass
|
||||
# with = 1 # now illegal
|
||||
with = 1
|
||||
@@ -1,80 +0,0 @@
|
||||
PyFile:WithStatement2.py
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# with = 1 # legal identifier')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# with = 1')
|
||||
PsiWhiteSpace('\n')
|
||||
PyAssignmentStatement
|
||||
PyTargetExpression: with
|
||||
PsiElement(Py:IDENTIFIER)('with')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
PyNumericLiteralExpression
|
||||
PsiElement(Py:INTEGER_LITERAL)('1')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# from __future__ import nested_scopes, with_statement')
|
||||
PsiWhiteSpace('\n')
|
||||
PyFromImportStatement
|
||||
PsiElement(Py:FROM_KEYWORD)('from')
|
||||
PsiWhiteSpace(' ')
|
||||
PyReferenceExpression: __future__
|
||||
PsiElement(Py:IDENTIFIER)('__future__')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IMPORT_KEYWORD)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:nested_scopes
|
||||
PyReferenceExpression: nested_scopes
|
||||
PsiElement(Py:IDENTIFIER)('nested_scopes')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PyImportElement:with_statement
|
||||
PyReferenceExpression: with_statement
|
||||
PsiElement(Py:IDENTIFIER)('with_statement')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# with x.y(z)[t] as y: pass')
|
||||
PsiWhiteSpace('\n')
|
||||
PyWithStatement
|
||||
PsiElement(Py:WITH_KEYWORD)('with')
|
||||
PsiWhiteSpace(' ')
|
||||
PyWithItem
|
||||
PySubscriptionExpression
|
||||
PyCallExpression: x.y
|
||||
PyReferenceExpression: y
|
||||
PyReferenceExpression: x
|
||||
PsiElement(Py:IDENTIFIER)('x')
|
||||
PsiElement(Py:DOT)('.')
|
||||
PsiElement(Py:IDENTIFIER)('y')
|
||||
PyArgumentList
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PyReferenceExpression: z
|
||||
PsiElement(Py:IDENTIFIER)('z')
|
||||
PsiElement(Py:RPAR)(')')
|
||||
PsiElement(Py:LBRACKET)('[')
|
||||
PyReferenceExpression: t
|
||||
PsiElement(Py:IDENTIFIER)('t')
|
||||
PsiElement(Py:RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:AS_KEYWORD)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
PyTargetExpression: y
|
||||
PsiElement(Py:IDENTIFIER)('y')
|
||||
PsiElement(Py:COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
PyStatementList
|
||||
PyPassStatement
|
||||
PsiElement(Py:PASS_KEYWORD)('pass')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(Py:END_OF_LINE_COMMENT)('# with = 1 # now illegal')
|
||||
PsiWhiteSpace('\n')
|
||||
PyWithStatement
|
||||
PsiElement(Py:WITH_KEYWORD)('with')
|
||||
PsiWhiteSpace(' ')
|
||||
PyWithItem
|
||||
PsiErrorElement:expression expected
|
||||
<empty list>
|
||||
PsiErrorElement:Colon expected
|
||||
PsiElement(Py:EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:INTEGER_LITERAL)('1')
|
||||
PyStatementList
|
||||
<empty list>
|
||||
@@ -119,11 +119,6 @@ public class PythonSkeletonsTest extends PyEnvTestCase {
|
||||
@Override
|
||||
protected void runTestOn(@NotNull Sdk sdk) {
|
||||
final LanguageLevel languageLevel = PythonSdkType.getLanguageLevelForSdk(sdk);
|
||||
// Named tuples have been introduced in Python 2.6
|
||||
if (languageLevel.isOlderThan(LanguageLevel.PYTHON26)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// XXX: A workaround for invalidating VFS cache with the test file copied to our temp directory
|
||||
LocalFileSystem.getInstance().refresh(false);
|
||||
|
||||
@@ -159,10 +154,6 @@ public class PythonSkeletonsTest extends PyEnvTestCase {
|
||||
@Override
|
||||
protected void runTestOn(@NotNull Sdk sdk) {
|
||||
final LanguageLevel languageLevel = PythonSdkType.getLanguageLevelForSdk(sdk);
|
||||
// We rely on int.real property that is not explicitly annotated in the skeletons generator
|
||||
if (languageLevel.isOlderThan(LanguageLevel.PYTHON26)) {
|
||||
return;
|
||||
}
|
||||
final Project project = myFixture.getProject();
|
||||
ApplicationManager.getApplication().runReadAction(() -> {
|
||||
final PyFile builtins = PyBuiltinCache.getBuiltinsForSdk(project, sdk);
|
||||
|
||||
@@ -311,11 +311,6 @@ public class PyQuickFixTest extends PyTestCase {
|
||||
doInspectionTest(PyStatementEffectInspection.class, PyBundle.message("QFIX.statement.effect.introduce.variable"), true, true);
|
||||
}
|
||||
|
||||
// PY-2083
|
||||
public void testUnresolvedWith() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON25, () -> doInspectionTest(PyUnresolvedReferencesInspection.class, PyBundle.message("QFIX.unresolved.reference.add.future"), true, true));
|
||||
}
|
||||
|
||||
// PY-2092
|
||||
public void testUnresolvedRefCreateFunction() {
|
||||
doInspectionTest(PyUnresolvedReferencesInspection.class,
|
||||
@@ -653,9 +648,10 @@ public class PyQuickFixTest extends PyTestCase {
|
||||
|
||||
// PY-8174
|
||||
public void testChangeSignatureAddKeywordOnlyParameter() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON30, () -> {
|
||||
doInspectionTest(PyArgumentListInspection.class, "<html>Change signature of func(x, *args, foo, <b>bar</b>)</html>", true, true);
|
||||
});
|
||||
runWithLanguageLevel(
|
||||
LanguageLevel.PYTHON30,
|
||||
() -> doInspectionTest(PyArgumentListInspection.class, "<html>Change signature of func(x, *args, foo, <b>bar</b>)</html>", true, true)
|
||||
);
|
||||
}
|
||||
|
||||
// PY-8174
|
||||
|
||||
@@ -47,21 +47,21 @@ public class PySdkFlavorTest extends PyTestCase {
|
||||
assertEquals(LanguageLevel.PYTHON34, flavor.getLanguageLevel(mockSdk));
|
||||
}
|
||||
|
||||
public void testJython25VersionString() {
|
||||
public void testJythonVersionString() {
|
||||
final PythonSdkFlavor flavor = JythonSdkFlavor.INSTANCE;
|
||||
final String versionOutput = "Jython 2.5.3\n";
|
||||
final String versionOutput = "Jython 2.6.3\n";
|
||||
final Sdk mockSdk = createMockSdk(flavor, versionOutput);
|
||||
assertEquals("Jython 2.5.3", mockSdk.getVersionString());
|
||||
assertEquals(LanguageLevel.PYTHON25, flavor.getLanguageLevel(mockSdk));
|
||||
assertEquals("Jython 2.6.3", mockSdk.getVersionString());
|
||||
assertEquals(LanguageLevel.PYTHON26, flavor.getLanguageLevel(mockSdk));
|
||||
}
|
||||
|
||||
public void testJython25WithWarningsVersionString() {
|
||||
public void testJythonWithWarningsVersionString() {
|
||||
final PythonSdkFlavor flavor = JythonSdkFlavor.INSTANCE;
|
||||
final String versionOutput = "\"my\" variable $jythonHome masks earlier declaration in same scope at /usr/bin/jython line 15.\n" +
|
||||
"Jython 2.5.3\n";
|
||||
"Jython 2.6.3\n";
|
||||
final Sdk mockSdk = createMockSdk(flavor, versionOutput);
|
||||
assertEquals("Jython 2.5.3", mockSdk.getVersionString());
|
||||
assertEquals(LanguageLevel.PYTHON25, flavor.getLanguageLevel(mockSdk));
|
||||
assertEquals("Jython 2.6.3", mockSdk.getVersionString());
|
||||
assertEquals(LanguageLevel.PYTHON26, flavor.getLanguageLevel(mockSdk));
|
||||
}
|
||||
|
||||
public void testPyPy23VersionString() {
|
||||
|
||||
@@ -171,10 +171,6 @@ public class PythonInspectionsTest extends PyTestCase {
|
||||
myFixture.checkHighlighting(true, false, true);
|
||||
}
|
||||
|
||||
public void testPyPropertyDefinitionInspection25() {
|
||||
doHighlightingTest(PyPropertyDefinitionInspection.class, LanguageLevel.PYTHON25);
|
||||
}
|
||||
|
||||
public void testPyPropertyDefinitionInspection26() {
|
||||
doHighlightingTest(PyPropertyDefinitionInspection.class, LanguageLevel.PYTHON26);
|
||||
}
|
||||
|
||||
@@ -111,14 +111,6 @@ public class PythonParsingTest extends ParsingTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testWithStatement2() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testImportStmt() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDecoratedFunction() {
|
||||
doTest();
|
||||
}
|
||||
@@ -375,7 +367,7 @@ public class PythonParsingTest extends ParsingTestCase {
|
||||
}
|
||||
|
||||
public void doTest() {
|
||||
doTest(LanguageLevel.PYTHON25);
|
||||
doTest(LanguageLevel.PYTHON26);
|
||||
}
|
||||
|
||||
public void testCompoundStatementAfterSemicolon() { // PY-7660
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class PyConvertCollectionLiteralIntentionTest extends PyIntentionTestCase
|
||||
|
||||
// PY-9419
|
||||
public void testConvertTupleToSetNotAvailableWithoutSetLiterals() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON25, () -> doNegativeTest(CONVERT_TUPLE_TO_SET));
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON26, () -> doNegativeTest(CONVERT_TUPLE_TO_SET));
|
||||
}
|
||||
|
||||
// PY-9419
|
||||
|
||||
+7
-7
@@ -24,19 +24,19 @@ import com.jetbrains.python.psi.LanguageLevel;
|
||||
public class PyStringConcatenationToFormatIntentionTest extends PyIntentionTestCase {
|
||||
|
||||
public void testSimple() {
|
||||
doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON25);
|
||||
doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON26);
|
||||
}
|
||||
|
||||
public void testAugmentAssignment() { //PY-5226
|
||||
doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON25);
|
||||
doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON26);
|
||||
}
|
||||
|
||||
public void testNegative() { //PY-6505
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON25, () -> doNegativeTest(PyBundle.message("INTN.replace.plus.with.format.operator")));
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON26, () -> doNegativeTest(PyBundle.message("INTN.replace.plus.with.format.operator")));
|
||||
}
|
||||
|
||||
public void testTwoStrings() { //PY-6505
|
||||
doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON25);
|
||||
doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON26);
|
||||
}
|
||||
|
||||
public void testUnknownType() { //PY-7969
|
||||
@@ -48,11 +48,11 @@ public class PyStringConcatenationToFormatIntentionTest extends PyIntentionTestC
|
||||
}
|
||||
|
||||
public void testUnicodeString() { //PY-7463
|
||||
doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON25);
|
||||
doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON26);
|
||||
}
|
||||
|
||||
public void testUnicodeSecondString() { //PY-7463
|
||||
doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON25);
|
||||
doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON26);
|
||||
}
|
||||
|
||||
// PY-8366
|
||||
@@ -62,7 +62,7 @@ public class PyStringConcatenationToFormatIntentionTest extends PyIntentionTestC
|
||||
|
||||
// PY-8588
|
||||
public void testEscaping() {
|
||||
doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON25);
|
||||
doTest(PyBundle.message("INTN.replace.plus.with.format.operator"), LanguageLevel.PYTHON26);
|
||||
}
|
||||
|
||||
public void testPy3() { //PY-4706
|
||||
|
||||
Reference in New Issue
Block a user