List<RatedResolveResult> () { PyPsiUtils.assertValid(myElement); ResolveResultList ret = new ResolveResultList(); final String referencedName = myElement.getReferencedName(); if (referencedName == null) return ret; final PyExpression qualifier = myElement.getQualifier(); PyPsiUtils.assertValid(qualifier); if (qualifier == null) { return ret; } // regular attributes PyType qualifierType = myContext.getTypeEvalContext().getType(qualifier); // is it a class-private name qualified by a different class? if (PyUtil.isClassPrivateName(referencedName) && qualifierType instanceof PyClassType) { if (isOtherClassQualifying(qualifier, (PyClassType)qualifierType)) return Collections.emptyList(); } // if (qualifierType != null) { qualifierType.assertValid("qualifier: " + qualifier); // resolve within the type proper AccessDirection ctx = AccessDirection.of(myElement); final List<? extends RatedResolveResult> membersOfQualifier = qualifierType.resolveMember(referencedName, qualifier, ctx, myContext); if (membersOfQualifier == null) { return ret; // qualifier is positive that such name cannot exist in it } ret.addAll(membersOfQualifier); } // look for assignment of this attribute in containing function if (qualifier instanceof PyQualifiedExpression && ret.isEmpty()) { if (addAssignedAttributes(ret, referencedName, (PyQualifiedExpression)qualifier)) { return ret; } } if ((PyTypeChecker.isUnknown(qualifierType, myContext.getTypeEvalContext()) || (qualifierType instanceof PyStructuralType && ((PyStructuralType)qualifierType).isInferredFromUsages())) && myContext.allowImplicits() && PyCallExpressionHelper.canQualifyAnImplicitName(qualifier)) { PyResolveUtil.addImplicitResolveResults(referencedName, ret, myElement); } // special case of __doc__ if ("__doc__".equals(referencedName)) { addDocReference(ret, qualifier, qualifierType); } return ret; }