Updates:
Cc: smi...@gmail.com
Comment #15 on issue 2406 by renato.c...@gmail.com: improve Tuple
constructor
http://code.google.com/p/sympy/issues/detail?id=2406
On github
(https://github.com/renatocoutinho/sympy/commit/195362051a3ae4759f448312f36855bd22598794#commitcomment-439794),
Comment #17 on issue 2406 by asmeurer: improve Tuple constructor
http://code.google.com/p/sympy/issues/detail?id=2406
The motivation is there in comment 7. In theory, fromiter could exit
early, whereas *args cannot. But, as I noted in comment 8, this can only
happen, at least for Add and
Comment #13 on issue 2406 by asmeurer: improve Tuple constructor
http://code.google.com/p/sympy/issues/detail?id=2406
I don't know much about how typing works. Would it be possible to make it
so type(Tuple())([1,2, 3]) returns Tuple(1, 2, 3) (the same as type(())([1,
2, 3]))?
--
You
Comment #14 on issue 2406 by renato.c...@gmail.com: improve Tuple
constructor
http://code.google.com/p/sympy/issues/detail?id=2406
I don't think there's any way to accomodate the signature of builtin
tuple() and the invariant imposed by `type(obj)(*obj.args) == obj` (issue
2070).
Comment #11 on issue 2406 by renato.c...@gmail.com: improve Tuple
constructor
http://code.google.com/p/sympy/issues/detail?id=2406
I just sent a pull request: https://github.com/sympy/sympy/pull/352
The fromiter() function just sympifies its args and pass on to
Basic.__new__. As it is,
Updates:
Labels: NeedsReview
Comment #12 on issue 2406 by renato.c...@gmail.com: improve Tuple
constructor
http://code.google.com/p/sympy/issues/detail?id=2406
(No comment was entered for this change.)
--
You received this message because you are subscribed to the Google Groups
Updates:
Labels: -Milestone-Release0.7.0 Milestone-Release0.7.1
Comment #6 on issue 2406 by asmeurer: improve Tuple constructor
http://code.google.com/p/sympy/issues/detail?id=2406
I don't understand how from_iter would fix the *args problem. Are you
suggesting to change the
Comment #7 on issue 2406 by ronan.l...@gmail.com: improve Tuple constructor
http://code.google.com/p/sympy/issues/detail?id=2406
@renato: If there's precedent from 'fromiter', I guess it's a better choice.
@Aaron: the convention would be changed from expr.__class__(*expr.args) to
Comment #8 on issue 2406 by asmeurer: improve Tuple constructor
http://code.google.com/p/sympy/issues/detail?id=2406
I see.
Well, I still think that Tuple should act like it does now, and that we
should create some conversion function to convert iterables to Tuples
(sympify() would call
Comment #9 on issue 2406 by renato.c...@gmail.com: improve Tuple constructor
http://code.google.com/p/sympy/issues/detail?id=2406
So for now we are:
1. sympifying arguments to Tuple
2. sympify(tuple()) - Tuple()
3. adding method fromiter() to Tuple()
4. keep Tuple([x, y, z]) - Tuple([x, y, z])
Comment #10 on issue 2406 by asmeurer: improve Tuple constructor
http://code.google.com/p/sympy/issues/detail?id=2406
Yes, just do it from the outset, i.e., #3 should be adding method
fromiter() to Basic.
And the rest are correct too.
--
You received this message because you are subscribed
Updates:
Status: NeedsDecision
Labels: Milestone-Release0.7.0
Comment #1 on issue 2406 by ronan.l...@gmail.com: improve Tuple constructor
http://code.google.com/p/sympy/issues/detail?id=2406
We should try to resolve this before the release, because it would be too
much of a
Comment #2 on issue 2406 by renato.c...@gmail.com: improve Tuple constructor
http://code.google.com/p/sympy/issues/detail?id=2406
I see. In fact, there's no way this would work like builtin tuple because
tuple() only accepts a single argument. I'm +1 on your suggestion.
--
You received this
Comment #3 on issue 2406 by renato.c...@gmail.com: improve Tuple constructor
http://code.google.com/p/sympy/issues/detail?id=2406
I implemented the sympification of the args in
https://github.com/renatocoutinho/sympy/commit/a7db82ff88baab2b21768d5cfa652eb69b998702
I had to do it in
Updates:
Status: Accepted
Comment #4 on issue 2406 by asmeurer: improve Tuple constructor
http://code.google.com/p/sympy/issues/detail?id=2406
Not only that, but there would be an inconsistency for nested Tuples:
Tuple((1, 2, 3)) (i.e., Tuple(tuple([1, 2, 3])))
Tuple(1, 2, 3)
Comment #5 on issue 2406 by renato.c...@gmail.com: improve Tuple constructor
http://code.google.com/p/sympy/issues/detail?id=2406
Another point I just noticed is that sympify(tuple()) - tuple(), not a
Tuple. So this is happening (in my branch):
Tuple((1, x), 3).subs(x, 0)
...
Status: New
Owner: renato.c...@gmail.com
Labels: Type-Enhancement Priority-Medium
New issue 2406 by renato.c...@gmail.com: improve Tuple constructor
http://code.google.com/p/sympy/issues/detail?id=2406
I've just recently discovered Tuple and find it very useful, but there are
two things I
17 matches
Mail list logo