From 1a87ccc4aef12fab372b8ee37b68223b8645e11e Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 29 Jul 2019 17:33:59 -0500 Subject: [PATCH] Use python 2,3 compatible syntax for doc strings --- pymbolic/__init__.py | 8 ++++---- pymbolic/mapper/evaluator.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pymbolic/__init__.py b/pymbolic/__init__.py index 70a7bea..e8d1552 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 aea4ce7..ac40e55 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 -- GitLab