mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
Namely, expressions like "foo().bar" don't return "bar" as their qualified name leading to mixing them up with references to local variables in CFG. Moreover, qualified expressions like "foo[0].bar" or "foo[0][1]" are not mapped to confusing qualified names "foo.__getitem__.bar" and "foo.__getitem__.__getitem__" respectively anymore. These "magic" names are preserved only as the trailing (rightmost) component of the result, and in all other cases asQualifiedName() returns null. It also allows us to use asQualifiedName() to check that the given reference expression is well-formed and contains only plain names as qualifiers, that, in particular, was necessary in TypingTypeProvider and PyTypingAliasStubType and assumed as possible in other places (but actually broken).
8 lines
93 B
Python
8 lines
93 B
Python
class MyClass:
|
|
foo = 'spam'
|
|
|
|
|
|
def f(foo):
|
|
foo.illegal = 42
|
|
MyClass().foo.<caret>
|