Hi Volker,

On 15 Sep., 11:45, Volker Braun <vbraun.n...@gmail.com> wrote:
> b in QQ is (or should be) equivalent to QQ(b) not throwing an error.

No, that's incorrect. It should be (and is) equivalent to QQ(b)==b
returning True.

QQ(b) is just a conversion. You can convert any element of a finite
prime field into QQ:

   sage: b = GF(5)(2)
   sage: QQ(b)
   2

However, the test "QQ(b)==b" is not only testing whether conversion
works, but also whether there is a coercion from the ring containing b
to QQ. In my example, there is no coercion, thus, no equality:

   sage: cm.explain(QQ, b.parent())
   Will try _r_action and _l_action
   Unknown result parent.
   sage: QQ(b) == b
   False

Hence, we have
   sage: b in QQ
   False

Best regards,
Simon

-- 
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