Tuple behaves different for summation of logical

18 views
Skip to first unread message

Duane Nykamp

unread,
Oct 18, 2014, 8:06:34 PM10/18/14
to sy...@googlegroups.com
Is this intentional behavior?


In [1]: from sympy import Tuple

In [2]: sum( (True, False, False))
Out[2]: 1

In [3]: sum(Tuple(True, False, False))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-602f84e54f9b> in <module>()
----> 1 sum(Tuple(True, False, False))

TypeError: unsupported operand type(s) for +: 'int' and 'BooleanTrue'



Sudhanshu Mishra

unread,
Oct 18, 2014, 8:11:17 PM10/18/14
to sy...@googlegroups.com
Hey Duane,

I think you've found  a bug. Could you please create an issue here https://github.com/sympy/sympy/issues.

Regards
Sudhanshu Mishra

--
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+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/cc0c30a3-a232-4772-b8dd-fc38b57fe50a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Duane Nykamp

unread,
Oct 18, 2014, 8:54:29 PM10/18/14
to sy...@googlegroups.com

Aaron Meurer

unread,
Oct 19, 2014, 12:27:24 AM10/19/14
to sy...@googlegroups.com
It's not a bug. I'll comment on the issue.

Aaron Meurer
> https://groups.google.com/d/msgid/sympy/60691f28-075b-4d85-a8e5-ec6d0e9b061d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages