#12834: Modify subs so that it can accept multiple equations just like subs_expr
-------------------------------------+-------------------------------------
Reporter: JoalHeagney | Owner: AlexGhitza
Type: enhancement | Status: needs_info
Priority: minor | Milestone: sage-6.4
Component: algebra | Resolution:
Keywords: subs algebra | Merged in:
solving | Reviewers: Vincent Delecroix,
Authors: Michael Orlitzky, | Michael Orlitzky
Vincent Delecroix | Work issues:
Report Upstream: N/A | Commit:
Branch: public/12834 | 02ca48403e7fa696c368250084d8d9eebd0de14f
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by vdelecroix):
* commit: 045eebfd67858405c6665acfa1eea5f22ca7fc6f =>
02ca48403e7fa696c368250084d8d9eebd0de14f
* branch: public/12384 => public/12834
Comment:
Replying to [comment:16 mjo]:
> @Vincent: Most of your changes look fine to me, thanks for picking this
up again. I have a few comments:
>
> 1. When making multiple duplicate substitutions, all of the errors are
no longer reported. This used to work like,
This is not really doable and makes no sense if there are a lot of
arguments like
{{{
sage: expr.subs((a == b), [a == c, x == 3], {a: 4})
}}}
The dictionary of substitutions is constructed sequentially.
I just removed the problematic doctest. If you prefer to report all
collisions, please tell me why...
> 2. I like the fact that you show the whole substitution in the error,
e.g. `ValueError: duplicate substitutions a->b and a->c`, but I think the
arrow notation is confusing.
You are perfectly right. This is now a whole sentence
{{{
duplicate substitution for a, got values 1 and 2
}}}
> 3. My "And finally, a list containing one of everything" test was meant
to show that we can handle all three types (symbolic equality, a dict, and
another list) at the same time. You noticed that I forgot tuples
(thanks!), but can we do them all at the same time? For example,[[BR]]
There is a now a doctest for that.
> 4. I agree that we can deprecate the other substitution methods
`subs_expr` and `substitute_expression`.
Done.
Vincent
----
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=0272d29eb24460669dcd59439998937ea52dbeac
0272d29]||{{{Trac 12834: merge sage-6.7.beta4}}}||
||[http://git.sagemath.org/sage.git/commit/?id=b6e196d835e163cc9263374223d453dd8b6dca65
b6e196d]||{{{Trac 12834: remove trailing whitespaces}}}||
||[http://git.sagemath.org/sage.git/commit/?id=a09094a35bb71998e17a3b36031400c9f856727e
a09094a]||{{{Trac 12834: review}}}||
||[http://git.sagemath.org/sage.git/commit/?id=02ca48403e7fa696c368250084d8d9eebd0de14f
02ca484]||{{{Trac 12834: fix the french book that is using subs_expr}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/12834#comment:18>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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/sage-trac.
For more options, visit https://groups.google.com/d/optout.