#16644: LinearCode.cardinality category breakage
-------------------------------------+-------------------------------------
       Reporter:  ppurka             |        Owner:
           Type:  enhancement        |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-6.3
      Component:  coding theory      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  public/categories/new_parent_linear_codes-16644|  
b48b62702d0d4ff382111ad093ac80808aef6231
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by tscrim):

 * status:  needs_work => needs_info
 * commit:  4ccae66296a47a62daf12fc8a6662439e6183f35 =>
     b48b62702d0d4ff382111ad093ac80808aef6231
 * branch:  u/ppurka/ticket/16644 =>
     public/categories/new_parent_linear_codes-16644


Comment:

 Because it doesn't initialize its category, we have:
 {{{
 sage: C = codes.HammingCode(3, GF(2))
 sage: C.__class__.__mro__
 (sage.coding.linear_code.LinearCode,
  sage.modules.module.Module_old,
  sage.structure.parent_gens.ParentWithAdditiveAbelianGens,
  sage.structure.parent_gens.ParentWithGens,
  sage.structure.parent_base.ParentWithBase,
  sage.structure.parent_old.Parent,
  sage.structure.parent.Parent,
  sage.structure.category_object.CategoryObject,
  sage.structure.sage_object.SageObject,
  object)
 }}}
 I believe the `__getattr__` in `parent.pyx` is why it gets listed by tab
 completion, but because the method doesn't actually exist in the MRO, it
 can't call it. Simon or Nicolas could probably give a better explanation.
 IMO it's not worth it to try and contrive a "proper" error message, but
 instead put a note somewhere that this is a sign that the category
 framework is being abused.

 So here's the branch which changes `LinearCode` to a new-style parent and
 all (non-long) tests pass in the coding folding. However because I don't
 know about codes, I can't implement an `_an_element_` for the test suite,
 nor do I know what the proper/best category is (i.e. are they finite
 dimensional modules? I'm guessing they are but IDK for sure). However this
 does fix the issue on this ticket.
 ----
 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=b48b62702d0d4ff382111ad093ac80808aef6231
 b48b627]||{{{Changed LinearCode into a new-style parent.}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/16644#comment:15>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to