void () { PyExpression expr = parseExpr(""" class C(object): pass x = C() expr = type(x) """); assertNotNull(expr); for (TypeEvalContext context : getTypeEvalContexts(expr)) { PyType type = context.getType(expr); assertInstanceOf(type, PyClassType.class); assertTrue("Got instance type instead of class type", ((PyClassType)type).isDefinition()); } }