mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-17331 Consider "class" as reserved word in Python, not "__class__"
This commit is contained in:
@@ -483,7 +483,7 @@ public class PyNames {
|
||||
EXCEPT,
|
||||
IMPORT,
|
||||
PRINT,
|
||||
__CLASS__,
|
||||
CLASS,
|
||||
EXEC,
|
||||
IN,
|
||||
RAISE,
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class Class:
|
||||
pass
|
||||
|
||||
|
||||
Cl<caret>ass()
|
||||
@@ -87,6 +87,12 @@ public class PyIntroduceVariableTest extends PyIntroduceTestCase {
|
||||
assertDoesntContain(suggestions, "select");
|
||||
}
|
||||
|
||||
// PY-17331
|
||||
public void testDontSuggestReservedName() {
|
||||
final Collection<String> suggestions = buildSuggestions(PyCallExpression.class);
|
||||
assertDoesntContain(suggestions, "class");
|
||||
}
|
||||
|
||||
public void testSuggestNamesNotInScope() { // PY-4605
|
||||
final Collection<String> strings = buildSuggestions(PyExpression.class);
|
||||
assertTrue(strings.contains("myfunc1"));
|
||||
|
||||
Reference in New Issue
Block a user