mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
Add support for bool literals in Py3+ (PY-29731)
This commit is contained in:
@@ -157,7 +157,8 @@ public class PyArgumentEqualDefaultInspection extends PyInspection {
|
||||
if (isBothInstanceOf(key, defaultValue, PyNumericLiteralExpression.class) ||
|
||||
isBothInstanceOf(key, defaultValue, PyPrefixExpression.class) ||
|
||||
isBothInstanceOf(key, defaultValue, PyBinaryExpression.class) ||
|
||||
isBothInstanceOf(key, defaultValue, PyNoneLiteralExpression.class)) {
|
||||
isBothInstanceOf(key, defaultValue, PyNoneLiteralExpression.class) ||
|
||||
isBothInstanceOf(key, defaultValue, PyBoolLiteralExpression.class)) {
|
||||
if (key.getText().equals(defaultValue.getText()))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -87,5 +87,12 @@ def decorator(arg='baz'):
|
||||
def f<error descr="'(' expected">:</error>
|
||||
pass
|
||||
|
||||
# PY-30335
|
||||
with open('file', <weak_warning descr="Argument equals to default parameter value">None</weak_warning>) as file:
|
||||
pass
|
||||
pass
|
||||
|
||||
# PY-29731
|
||||
def py29731(p=True):
|
||||
pass
|
||||
|
||||
py29731(<weak_warning descr="Argument equals to default parameter value">True</weak_warning>)
|
||||
@@ -0,0 +1,5 @@
|
||||
# PY-29731
|
||||
def py29731(p=True):
|
||||
pass
|
||||
|
||||
py29731(<weak_warning descr="Argument equals to default parameter value">True</weak_warning>)
|
||||
@@ -228,6 +228,10 @@ public class PythonInspectionsTest extends PyTestCase {
|
||||
doHighlightingTest(PyArgumentEqualDefaultInspection.class);
|
||||
}
|
||||
|
||||
public void testPyArgumentEqualDefaultInspectionPy3() {
|
||||
doHighlightingTest(PyArgumentEqualDefaultInspection.class, LanguageLevel.PYTHON34);
|
||||
}
|
||||
|
||||
public void testPyNonAsciiCharInspection() { //PY-5868
|
||||
doHighlightingTest(PyNonAsciiCharInspection.class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user