void () { runWithLanguageLevel( LanguageLevel.PYTHON36, () -> { final PyExpression definition = parseExpr(""" from typing import NamedTuple class User(NamedTuple): name: str level: int = 0 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), PyClassType.class); } final PyExpression instance = parseExpr(""" from typing import NamedTuple class User(NamedTuple): name: str level: int = 0 expr = User("name")"""); 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), PyClassType.class); } } ); }