Re: [sympy] Blog post about SymPy 1.4

2019-05-02 Thread Aaron Meurer
On Thu, May 2, 2019 at 6:44 PM Aaron Meurer  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
https://github.com/sympy/sympy/issues/16362

Aaron Meurer

>
> 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
>
> On Thu, May 2, 2019 at 6:20 PM Oscar Benjamin 
> wrote:
>
>> On Thu, 2 May 2019 at 23:09, Ondřej Čertík  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
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To post to this group, send email to sympy@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.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@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/CAKgW%3D6LS%2BVaMt3bQU1AcRHdfdJd3uev0%3DDhsHZhxHjcVJo6RTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Blog post about SymPy 1.4

2019-05-02 Thread Aaron Meurer
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

On Thu, May 2, 2019 at 6:20 PM Oscar Benjamin 
wrote:

> On Thu, 2 May 2019 at 23:09, Ondřej Čertík  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
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@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.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@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/CAKgW%3D6LXxFj8ucPkmMcw%2Bj5eC53jJBxkhUj35gSi6pJm%3D%2BaacQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Blog post about SymPy 1.4

2019-05-02 Thread Oscar Benjamin
On Thu, 2 May 2019 at 23:09, Ondřej Čertík  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

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@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.


Re: [sympy] Blog post about SymPy 1.4

2019-05-02 Thread Ondřej Čertík



On Thu, May 2, 2019, at 11:57 AM, Aaron Meurer wrote:
> 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/.

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

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@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/b8c891b4-5a74-4df3-8c74-68d7b593db88%40www.fastmail.com.
For more options, visit https://groups.google.com/d/optout.