void () { runWithLanguageLevel( LanguageLevel.PYTHON36, () -> { final PyExpression definition = parseExpr(""" from collections import namedtuple class User(namedtuple("User", "name level")): pass expr = User"""); for (TypeEvalContext context : getTypeEvalContexts(definition)) { final PyType type = context.getType(definition); assertInstanceOf(type, PyClassType.class); final List<PyClassLikeType> superClassTypes = ((PyClassType)type).getSuperClassTypes(context); assertEquals(1, superClassTypes.size()); assertInstanceOf(superClassTypes.get(0), PyNamedTupleType.class); } final PyExpression instance = parseExpr(""" from collections import namedtuple class User(namedtuple("User", "name level")): pass expr = User('MrRobot')"""); for (TypeEvalContext context : getTypeEvalContexts(instance)) { final PyType type = context.getType(instance); assertInstanceOf(type, PyClassType.class); final List<PyClassLikeType> superClassTypes = ((PyClassType)type).getSuperClassTypes(context); assertEquals(1, superClassTypes.size()); assertInstanceOf(superClassTypes.get(0), PyNamedTupleType.class); } } ); }