Blog post about SymPy 1.4

36 views
Skip to first unread message

Aaron Meurer

unread,
May 2, 2019, 1:57:52 PM5/2/19
to sympy
I have written a post on my blog about some of the new features in
SymPy 1.4. https://www.asmeurer.com/blog/posts/whats-new-in-sympy-14/
The post is also cross posted to the Quansight Labs blog
https://labs.quansight.org/blog/2019/04/whats-new-in-sympy-14/.

Aaron Meurer

Ondřej Čertík

unread,
May 2, 2019, 6:09:59 PM5/2/19
to sympy
Once we drop Python 2.7, we should experiment with using the type annotation and MyPy to statically check (eventually) the whole code base. I think this will find bugs, improve the development experience and make it much easier to understand from reading the code what kind of argument a function expects.

Ondrej

Oscar Benjamin

unread,
May 2, 2019, 8:20:41 PM5/2/19
to sympy
On Thu, 2 May 2019 at 23:09, Ondřej Čertík <ond...@certik.us> wrote:
>
> Once we drop Python 2.7, we should experiment with using the type annotation and MyPy to statically check (eventually) the whole code base. I think this will find bugs, improve the development experience and make it much easier to understand from reading the code what kind of argument a function expects.

This would pick up bugs. It would also not be easy to introduce
because so many SymPy functions have inconsistent return types. I'm
not even sure what the full type spec for solve would be.

--
Oscar

Aaron Meurer

unread,
May 2, 2019, 8:45:05 PM5/2/19
to sy...@googlegroups.com
I think that shows they would also help design cleaner APIs. One of the motivations of solveset() was to give a more consistent return type compared to solve(). They can also help avoid type confusions like 
https://github.com/sympy/sympy/issues/16362 (type confusions are especially common around sets and booleans).

I'm a little sceptical how far type hints can get us for SymPy since most functions just take an Expr and return an Expr. But I think it's worth playing around with, and perhaps in some submodules it could be quite helpful. Certainly having the annotations there won't be harmful, since they don't actually do anything unless you pass them through the right tools. 

Aaron Meurer

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAHVvXxR7sbMKUa5ZpSLLqvkTJqTNAPONgoA9MZdKXPYL7B3j3Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Aaron Meurer

unread,
May 2, 2019, 8:46:27 PM5/2/19
to sy...@googlegroups.com
On Thu, May 2, 2019 at 6:44 PM Aaron Meurer <asme...@gmail.com> wrote:
I think that shows they would also help design cleaner APIs. One of the motivations of solveset() was to give a more consistent return type compared to solve(). They can also help avoid type confusions like 
https://github.com/sympy/sympy/issues/16362 (type confusions are especially common around sets and booleans).

My mobile version of gmail did something weird here. Here is the correct link 

Aaron Meurer 

David Bailey

unread,
May 3, 2019, 12:48:36 PM5/3/19
to sympy
SymPy 1.4 is clearly a significant advance - but I am not clear if it is possible to get at the output in its non-Tex form in order to copy/paste it - say into a new input cell.

Aaron Meurer

unread,
May 3, 2019, 1:17:38 PM5/3/19
to sympy
In Jupyter you can always use print() to output the string form of an
expression. I'll add a note about this to the blog post.

Aaron Meurer

On Fri, May 3, 2019 at 10:48 AM David Bailey <da...@dbailey.co.uk> wrote:
>
> SymPy 1.4 is clearly a significant advance - but I am not clear if it is possible to get at the output in its non-Tex form in order to copy/paste it - say into a new input cell.
>
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/7dfb134a-dd7e-42d6-9821-7966cdaeb23c%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages