On Thu, 13 Sep 2018 at 13:42, Erik Bray <erik.m.b...@gmail.com> wrote:

> Hi all,
>
> This class has a doctest that is failing on Python 3, and it's not
> clear to me whether the bug is really in the code, or the test itself.
>
> The test that's failing is:
>
>             sage: R.<x> = QQ[]
>             sage: V = span(R,[[x,1+x],[x^2,2+x]])
>             sage: W = RR^2
>

I expect that is a typo for W=R^2.  Otherwise, as you say, it is a
nonsensical comparison.


>             sage: from sage.modules.free_module import EchelonMatrixKey
>             sage: V = EchelonMatrixKey(V)
>             sage: W = EchelonMatrixKey(W)
>             sage: V < W
>             True
>

 It certainly should not return True here: as it is a nonsensical
comparison some kind of ValueError seems better than False though.



>
> It doesn't really make a lot of sense, because this ends up calling
> FreeModule_ambient._echelon_matrix_richcmp(V, W).  The two arguments
> happen to have the same rank, but different base rings neither of
> which are subrings of each other (specifically, fraction field of
> polynomials over QQ, and Real Field with 53 bits precision).
>
> The code ends up just comparing the base fields with <, which on
> Python 2 "works" because it falls back on nonsensical defaults, but on
> Python 3 this (expectedly) crashes with a TypeError.
>
> However, reading the documentation for EchelonMatrixKey and
> echelon_matrix_richcmp gives me the impression that this nonsensical
> comparison isn't really the right behavior in the first place, but I'm
> not sure.  Any experts on this code want to weight in?
>
> --
> 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 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+unsubscr...@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.

Reply via email to