It's a neat idea but I agree with the others that as proposed, it's probably too focused on turning python into a better mathematics tool, rather than turning python into a better programming language.

That being said, from a more generalist standpoint I wonder if it would be useful in many connects other than symbolic math to have a way to "get to" and work with the actual written code in a module from inside that same module. Essentially to parse actual lines of code, not strings containing code, into an AST, and work with it. The "poison the well" approach is an interesting idea from that standpoint.

On Wed, May 19, 2021, 6:32 AM Jonathan Fine <> wrote:
Martin wrote:

as you might have noticed, I am trying to improve the syntax and semantics for symbolic math in Python. Until now, I have to say, my ideas were not that well received, but I learned from the discussion and maybe this time I come up with something people like.

For about 10 years I've used PARI/gp for computer algebra, mainly for integer linear algebra and polynomials. One day I might use its number theory features.

Lately it's acquired good Python bindings, and most likely for my next project I'll start using them.

Regarding semantics, I'm very happy to go along with PARI/gp. This is in part because of its deep roots in computational number theory and the community it has around it.

See also: Integer Factorization Software: PARI/GP, Mathematica, and SymPy

Regarding syntax, I'd be pleased to see a paritools package that makes it easier to use the cypari2 bindings for common purposes. This perhaps could become part of sympy. It's also worth looking at sage.

This is what I would like. Other people will most likely have different wishes for improving symbolic math in Python.


Python-ideas mailing list --
To unsubscribe send an email to
Message archived at
Code of Conduct: