mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed PY-11277 Python: Wrong "argument equals default" inspection
This commit is contained in:
@@ -131,6 +131,10 @@ public class PyArgumentEqualDefaultInspection extends PyInspection {
|
||||
if (key.getText().equals(defaultValue.getText()))
|
||||
return true;
|
||||
}
|
||||
if (key instanceof PyBinaryExpression && defaultValue instanceof PyBinaryExpression) {
|
||||
if (key.getText().equals(defaultValue.getText()))
|
||||
return true;
|
||||
}
|
||||
else if (key instanceof PyStringLiteralExpression && defaultValue instanceof PyStringLiteralExpression) {
|
||||
if (((PyStringLiteralExpression)key).getStringValue().equals(((PyStringLiteralExpression)defaultValue).getStringValue()))
|
||||
return true;
|
||||
|
||||
@@ -67,3 +67,9 @@ kw['customerPaymentProfileId'] = kw.get("customerPaymentProfileId",
|
||||
|
||||
{1: 2}.get('foo', None) #pass
|
||||
{1: 2}.pop('foo', None) #pass
|
||||
|
||||
def a(foo=1*1024):
|
||||
print foo
|
||||
|
||||
a( 1024*1024)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user