From 5aa571fc540b97aeb845312b5ff8cdb947e0360d Mon Sep 17 00:00:00 2001 From: Davide Gerosa Date: Sun, 6 Jun 2021 13:52:21 +0100 Subject: [PATCH] Remove whitespaces before/after parenthesis This removes whitespaces for compatibility with flake8 [E201](https://www.flake8rules.com/rules/E201.html) and [E202](https://www.flake8rules.com/rules/E202.html). --- ToPython.wl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ToPython.wl b/ToPython.wl index b5c2952..8429dbc 100644 --- a/ToPython.wl +++ b/ToPython.wl @@ -19,8 +19,8 @@ the Numpy python-ready expression (to be copied as a string); ------------------------------------------------------; Not tested for every possible combination; use at your risk, by Gustavo Wiederhecker*) If[numpyprefix=="",sep="",sep="."];(*if no prefix is included, the "." separator is not used*) -lp="( "; -rp=" )"; +lp="("; +rp=")"; PythonForm[Rational[a_,b_]]:=PythonForm[a]<>"/"<>PythonForm[b]; PythonForm[Complex[a_,b_]]:="complex"<>lp<>PythonForm[a]<>","<>PythonForm[b]<>rp; PythonForm[Times[a_,b_]]:=PythonForm[a]<>" * "<>PythonForm[b];