diff --git a/python/src/com/jetbrains/python/psi/impl/PyCallExpressionHelper.java b/python/src/com/jetbrains/python/psi/impl/PyCallExpressionHelper.java index f7b87c4ef41f..fee8f42449c1 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyCallExpressionHelper.java +++ b/python/src/com/jetbrains/python/psi/impl/PyCallExpressionHelper.java @@ -420,9 +420,6 @@ public class PyCallExpressionHelper { } final PyType providedType = PyReferenceExpressionImpl.getReferenceTypeFromProviders(target, context, call); if (providedType != null) { - if (providedType instanceof PyClassType) { - return ((PyClassType)providedType).toInstance(); - } return providedType; } if (target instanceof Callable) { diff --git a/python/testData/inspections/PyCallingNonCallableInspection/qualifiedNamedTuple.py b/python/testData/inspections/PyCallingNonCallableInspection/qualifiedNamedTuple.py new file mode 100644 index 000000000000..452f51a8aa81 --- /dev/null +++ b/python/testData/inspections/PyCallingNonCallableInspection/qualifiedNamedTuple.py @@ -0,0 +1,4 @@ +import collections + +Point = collections.namedtuple('Point', 'x y') +p1 = Point(1, 2) diff --git a/python/testSrc/com/jetbrains/python/inspections/PyCallingNonCallableInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyCallingNonCallableInspectionTest.java index dde5f89679d7..78323957e912 100644 --- a/python/testSrc/com/jetbrains/python/inspections/PyCallingNonCallableInspectionTest.java +++ b/python/testSrc/com/jetbrains/python/inspections/PyCallingNonCallableInspectionTest.java @@ -69,6 +69,11 @@ public class PyCallingNonCallableInspectionTest extends PyTestCase { doTest(); } + // PY-8801 + public void testQualifiedNamedTuple() { + doTest(); + } + private void doTest() { setLanguageLevel(LanguageLevel.PYTHON27); try {