วันพุธที่ 5 กรกฎาคม พ.ศ. 2560

Re: [sage-devel] Sequence universe

This is now https://trac.sagemath.org/ticket/23371.  Thanks for the report!
David

On Wed, Jul 5, 2017 at 2:11 AM, Mathis CARISTAN <mathis.caristan@gmail.com> wrote:
Hi,

I noticed a behaviour of Sequences that seems wrong to me. If I have a Sequence with a given universe, I can add elements that are not included in this universe.

For example :
sage: foo = Sequence([], universe=ZZ)
sage: foo += [1/2]
sage: foo, foo.universe(), foo[0].parent()
([1/2], Integer Ring, Rational Field)

but if I do :
sage: foo = Sequence([], universe=ZZ)
sage: foo.append(1/2)
I get a 'TypeError : Unable to coerce I to a rational'

This does not only happen for ZZ/QQ, and even if the initial sequence is not empty.

Mathis

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscribe@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscribe@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

ไม่มีความคิดเห็น:

แสดงความคิดเห็น