#12541: Remove Sequence test in span
------------------------------+---------------------------------------------
Reporter: novoselt | Owner: jason, was
Type: defect | Status: positive_review
Priority: minor | Milestone: sage-5.0
Component: linear algebra | Keywords:
Work_issues: | Upstream: N/A
Reviewer: Rob Beezer | Author: Andrey Novoseltsev
Merged: | Dependencies:
------------------------------+---------------------------------------------
Description changed by rbeezer:
Old description:
> In Sage-5.0.beta4:
> {{{
> sage: span({0:vector([0,1])}, QQ)
> ---------------------------------------------------------------------------
> TypeError Traceback (most recent call
> last)
>
> /home/novoselt/Dropbox/Research/The 14th Case (personal copy)/<ipython
> console> in <module>()
>
> /home/novoselt/sage-5.0.beta4/local/lib/python2.7/site-
> packages/sage/modules/free_module.pyc in span(gens, base_ring, check,
> already_echelonized)
> 518 else:
> 519 M = x.parent()
> --> 520 return M.span(gens=gens, base_ring=base_ring,
> check=check, already_echelonized=already_echelonized)
> 521
> 522
> ###############################################################################
>
> /home/novoselt/sage-5.0.beta4/local/lib/python2.7/site-
> packages/sage/modules/free_module.pyc in span(self, gens, base_ring,
> check, already_echelonized)
> 2553 if is_FreeModule(gens):
> 2554 gens = gens.gens()
> -> 2555 if not isinstance(gens, (list, tuple, Sequence)):
> 2556 raise TypeError, "Argument gens (= %s) must be a
> list, tuple, or sequence."%gens
> 2557 if base_ring is None or base_ring == self.base_ring():
>
> TypeError: isinstance() arg 2 must be a class, type, or tuple of classes
> and types
> }}}
> Such a command is likely to be a mistake, but the error message is
> irrelevant and is triggered by using a function name `Sequence` in
> `isinstance`. The attached patch removes this test as sequences are
> instances of lists and are correctly recognized anyway.
New description:
In Sage-5.0.beta4:
{{{
sage: span({0:vector([0,1])}, QQ)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/home/novoselt/Dropbox/Research/The 14th Case (personal copy)/<ipython
console> in <module>()
/home/novoselt/sage-5.0.beta4/local/lib/python2.7/site-
packages/sage/modules/free_module.pyc in span(gens, base_ring, check,
already_echelonized)
518 else:
519 M = x.parent()
--> 520 return M.span(gens=gens, base_ring=base_ring, check=check,
already_echelonized=already_echelonized)
521
522
###############################################################################
/home/novoselt/sage-5.0.beta4/local/lib/python2.7/site-
packages/sage/modules/free_module.pyc in span(self, gens, base_ring,
check, already_echelonized)
2553 if is_FreeModule(gens):
2554 gens = gens.gens()
-> 2555 if not isinstance(gens, (list, tuple, Sequence)):
2556 raise TypeError, "Argument gens (= %s) must be a list,
tuple, or sequence."%gens
2557 if base_ring is None or base_ring == self.base_ring():
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes
and types
}}}
Such a command is likely to be a mistake, but the error message is
irrelevant and is triggered by using a function name `Sequence` in
`isinstance`. The attached patch removes this test as sequences are
instances of lists and are correctly recognized anyway.
'''Apply:'''
[attachment:trac_12541_remove_isinstance_Sequence_in_span.patch]
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12541#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.