How do you handle identical keys in dictionaries?
On Tuesday, October 29, 2013 8:53:59 PM UTC+1, Chris Smith wrote:
>
> Does anyone else think that the desmos graphing method of defining
> piecewise functions is worth emulating: they use a dictionary
> representation. This is very clean and more transparent than the current
> format:
>
> instead of
>
> >>> Piecewise(
> ... (3,x<0),
> ... (0,True))
>
> we could allow
>
> >>> Piecewise({
> ... 3:x<0,
> ... 0:True})
>
> For compatibility we can still store it as tuples (or modify attribute
> functions so they give tuples) but allowing that alternate input might be
> nice.
>
> Note: desmos switches the expression/condition order so the key is the
> condition and the value the expression.
> /c
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.