Hi Eric,

On 2014-06-02, Eric Gourgoulhon <egourgoul...@gmail.com> wrote:
> In this frame, there should be two distinct zero elements, namely A.zero()=
>=20
> and B.zero(), i.e. we should have
>   A.zero() =3D=3D B.zero()
> but
>   A.zero() is B.zero()
> should return False. Correct ?

If you rely on the default mechanisms and establish a coercion from B to
A, then
  A.zero() == B.zero()
is equivalent to
  A.zero() == A(B.zero())
Presumably A(B.zero()) will return A.zero().
Hence, probably you do not need to do anything special to establish
equality of A.zero() and B.zero().

Probably it would be possible to implement the sub-structur B of A with
"facade parents". See, for example, Primes.__init__. This means that the
the elements of B are actually elements of A, i.e.
  sage: B.zero().parent() is A
  True
  sage: B.zero() is A.zero()
  True

However, if you decide that B has features that are sufficiently
different from A, you can implement a "usual" parent-element relation,
hence
  sage: B.zero().parent() is A
  False
  sage: B.zero().parent() is B
  True
  sage: B.zero() is A.zero()
  False

Cheers,
Simon


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to