void () { runWithLanguageLevel( LanguageLevel.PYTHON36, () -> { final PyExpression definition = parseExpr(""" from collections import namedtuple User = namedtuple("User", "name level") expr = User"""); for (TypeEvalContext context : getTypeEvalContexts(definition)) { assertInstanceOf(context.getType(definition), PyNamedTupleType.class); } final PyExpression instance = parseExpr(""" from collections import namedtuple User = namedtuple("User", "name level") expr = User('MrRobot')"""); for (TypeEvalContext context : getTypeEvalContexts(instance)) { assertInstanceOf(context.getType(instance), PyNamedTupleType.class); } } ); }