void () { final PyEvaluator evaluator = new PyEvaluator(); evaluator.setEvaluateKeys(false); final Map map = PyUtil.as(evaluator.evaluate(parseText("a='a'\none=1\ntwo=2\nb='b'\nexpr={a: one, two: b}")), Map.class); assertNotNull(map); assertEquals(2, map.size()); final AtomicInteger checks = new AtomicInteger(); map.forEach( (k, v) -> { if (v instanceof Integer) { assertEquals(1, v); assertInstanceOf(k, PyReferenceExpression.class); assertEquals("a", evaluator.evaluate((PyReferenceExpression)k)); checks.incrementAndGet(); } else if (v instanceof String) { assertEquals("b", v); assertInstanceOf(k, PyReferenceExpression.class); assertEquals(2, evaluator.evaluate((PyReferenceExpression)k)); checks.incrementAndGet(); } } ); assertEquals(2, checks.get()); }