diff --git a/pymbolic/__init__.py b/pymbolic/__init__.py index 70a7bea5d5ddd0ce8f63ba9402b763d4bc67504b..e8d1552f19739429b3ab8cc78bcdeff43c9f7266 100644 --- a/pymbolic/__init__.py +++ b/pymbolic/__init__.py @@ -51,7 +51,7 @@ Next, let's create an expression using *x*: >>> u = (x+1)**5 >>> u Power(Sum((Variable('x'), 1)), 5) - >>> print u + >>> print(u) (x + 1)**5 Note the two ways an expression can be printed, namely :func:`repr` and @@ -62,7 +62,7 @@ you put in. It has a few of those built in, but that's not really the point: .. doctest:: - >>> print pmbl.differentiate(u, 'x') + >>> print(pmbl.differentiate(u, 'x')) 5*(x + 1)**4 .. _custom-manipulation: @@ -81,9 +81,9 @@ products: ... def map_sum(self, expr): ... return pmbl.primitives.Product(expr.children) ... - >>> print u + >>> print(u) (x + 1)**5 - >>> print MyMapper()(u) + >>> print(MyMapper()(u)) (x*1)**5 Custom Objects diff --git a/pymbolic/mapper/evaluator.py b/pymbolic/mapper/evaluator.py index aea4ce7982e8f6cca5372bd044d4f8c761091a43..ac40e55bfacddb42cdc6cd44202d946bd23a1383 100644 --- a/pymbolic/mapper/evaluator.py +++ b/pymbolic/mapper/evaluator.py @@ -41,7 +41,7 @@ class EvaluationMapper(RecursiveMapper, CSECachingMapperMixin): >>> x = p.Variable("x") >>> u = 5*x**2 - 3*x - >>> print u + >>> print(u) 5*x**2 + (-1)*3*x >>> from pymbolic.mapper.evaluator import EvaluationMapper as EM