This is related to the discussion here
https://github.com/sympy/sympy/issues/17280.

I like the idea. The implementation of __new__ is often quite
confusing, and it isn't always clear if you are doing it correctly.
That's not to mention that most people aren't used to using __new__ in
Python. We already do basically this for Function subclasses, and it
works quite well.

I would start by consolidating the __new__ logic and introducing the
new method (maybe we should reuse the eval() name from Function?).
Then once we have that working, we can look at adding new automatic
behavior to __new__ like the things you mentioned.

Aaron Meurer

On Fri, Nov 8, 2019 at 3:21 PM Francesco Bonazzi
<franz.bona...@gmail.com> wrote:
>
> Constructors are being overloaded many times in SymPy.
>
> The way a constructor is supposed to be written is quite standard, but there 
> are so many ways they are being written and mis-written.
>
> Should we rather replace __new__ with something different (like, for example, 
> _eval_new?)
>
> Advantages:
>
> external control over evaluate=True/False,
> standardized way of creating properties and storing variables,
> automatic sympification for all args,
> type checks at construction can be easily introduced.
>
> --
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/7270b2d3-f3d6-4f5e-98c8-dec79154f88a%40googlegroups.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6L1DPdnGbixKkiReGWfutUWiq%2Btxm0v48nTNX83dLPUjQ%40mail.gmail.com.

Reply via email to