It turns out that Gson is able to override even final fields with an
instance created using the default no-args constructor, hence one
has to provide an explicit InstanceCreator for a type to customize the
result value.
but properly take them into account in PyClassType#getMetaClassType().
This check was implemented there instead of PyClass#getMetaClassType()
itself, since the former method already looks up for explicitly declared
metaclasses in ancestors unlike PyClassImpl that considers only those
specified directly in the class definition or its containing module.
Moreover, there are actual usages that expects such behavior from
PyClass#getMetaClassType(), e.g. PyAbstractClassInspection.
in case this relationship was created implicitly by inheriting an
instance of metaclass.
It also fixes warnings about the first parameter of SQLAlchemy model
methods being named "self" instead of "cls" since we no longer consider
these classes descendants of "type".
Previously we failed to find it due to resolving to only one element.
Now we resolve to multiple elements, which in this case includes the
target expression for a global variable and its 'global' statement.
It is not actually exposed anywhere in Python code style settings and
defaults to false thus affecting parenthesized multiline (chained)
qualified references and calls. Previously, oddly enough, this
behavior was controlled by ALIGN_COLLECTIONS_AND_COMPREHENSIONS flag.
Namely, don't use Scope to find an annotation if AST access is not
allowed.
Added tests on handling of top-level variable annotations and class
attributes annotations in other files. Supposedly, we don't resolve
to unqualified target expressions in other scopes when unstubbing is
forbidden (ordinary local variables are not preserved in PSI stubs).
Additionally, I did the following:
* re-generated lists of supported/unsupported interpreter modules
* updated test data wherever Python versions appear in warnings
Still need to figure out, though, why _bz2/bz2 modules were not found
for some old versions of Python, hence information about their presense
should be updated by hand in versions.xml.