Hi Simon,

On Mon, 25 Oct 2010 00:41:07 -0700 (PDT)
Simon King <simon.k...@nuigalway.ie> wrote:

> @symbolic experts (Burcin et al):
> Is it really necessary that x.operator() returns None and x.operands()
> returns []? What about an identity operator?

The operator and operands don't have a meaning if you have a single
variable. I agree that the current behavior is confusing:

sage: x.operands()
[]
sage: x.operator() is None
True

I suggest we raise a ValueError when there is no operator or operands.
This is already done for iterators of symbolic expressions in #7537:

http://trac.sagemath.org/sage_trac/ticket/7537

Can you open a ticket to do the same for operands() and operator()?

> Is it really necessary to break s.operands() into smaller pieces in
> order to reconstruct a sum? Why can' op_add accept an argument list of
> arbitrary length, in particular since the list of operands of a sum
> can be longer than two?

You are right, for add and mul we should return a function that can
handle multiple arguments. I am not sure if the top level sum() and
prod() functions would be suitable here though.

Can you open a ticket for this as well?


Thank you.

Burcin

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to