#11166: Typo in initialization of FreeModule_generic_field
------------------------------+---------------------------------------------
   Reporter:  nborie          |          Owner:  nborie      
       Type:  defect          |         Status:  needs_review
   Priority:  major           |      Milestone:  sage-4.7.1  
  Component:  linear algebra  |       Keywords:              
Work_issues:                  |       Upstream:  N/A         
   Reviewer:                  |         Author:              
     Merged:                  |   Dependencies:              
------------------------------+---------------------------------------------

Old description:

> A base_field become base_ring... I is very funny this bug never make
> things going bad.
>
> {{{
> sage: from sage.modules.free_module import FreeModule_generic_field
> sage: FreeModule_generic_field(QQ, 5, 5)
> Traceback (most recent call last):
> ...
> NameError: global name 'base_ring' is not defined
> }}}
>
> And in the code:
> {{{
> class FreeModule_generic_field(FreeModule_generic_pid):
>     ...
>     def __init__(self, base_field, dimension, degree, sparse=False):
>         ...
>         FreeModule_generic_pid.__init__(self, base_ring, dimension,
> degree, sparse=sparse)
> }}}
>
> As the creation is done with a factory, This bug is invisible from the
> user. But, if you want to build your own FreeModule over a field with
> category and some other stuff, calling the __init__ of this class make me
> fall on the bug.

New description:

 `base_field` became `base_ring`...  it is very funny this bug never made
 things go bad.

 {{{
 sage: from sage.modules.free_module import FreeModule_generic_field
 sage: FreeModule_generic_field(QQ, 5, 5)
 Traceback (most recent call last):
 ...
 NameError: global name 'base_ring' is not defined
 }}}

 And in the code:
 {{{
 class FreeModule_generic_field(FreeModule_generic_pid):
     ...
     def __init__(self, base_field, dimension, degree, sparse=False):
         ...
         FreeModule_generic_pid.__init__(self, base_ring, dimension,
 degree, sparse=sparse)
 }}}

 As the creation is done with a factory, this bug is invisible from the
 user. But, if you want to build your own `FreeModule` over a field with
 category and some other stuff, calling the `__init__` of this class make
 me fall on the bug.

 Apply:

  1. [attachment:trac_11166_FreeModule_generic_field-nb.patch]
  1. [attachment:trac_11166_doctest.patch]

--

Comment(by ltw):

 Patch looks good and passes `sage --testall --long` on 4.7. I think all
 that is missing is a doctest that directly exercises this function.
 Someone needs to carefully check whether my attempt at a doctest is
 sufficient.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11166#comment:2>
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.

Reply via email to