Opened 6 years ago

Closed 6 years ago

#17576 closed enhancement (fixed)

FreeModule.__contains__ is too lax in its test

Reported by: nbruin Owned by:
Priority: trivial Milestone: sage-6.5
Component: linear algebra Keywords:
Cc: kcrisman Merged in:
Authors: Peter Bruin Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 176e773 (Commits) Commit: 176e773ba68d3e56b91fb51c5ff20add97db5eaf
Dependencies: #10513 Stopgaps:

Description (last modified by pbruin)


sage: V = VectorSpace(RDF,3)
sage: v2 = vector(RDF, [1, 2, 3, 4])
sage: v2 in V

The containment test for free modules sage.modules.free_module.FreeModule_ambient.__contains__ doesn't bother testing that the *number* of entries matches the rank.

This is fixed by #10513; we just add a doctest.

Change History (5)

comment:1 Changed 6 years ago by kcrisman

  • Cc kcrisman added

comment:2 Changed 6 years ago by pbruin

  • Work issues set to add doctest

This should be solved by #10513 (which eliminates the custom __contains__() method).

comment:3 Changed 6 years ago by pbruin

  • Authors set to Peter Bruin
  • Branch set to u/pbruin/17576-FreeModule_contains
  • Commit set to 176e773ba68d3e56b91fb51c5ff20add97db5eaf
  • Dependencies set to #10513
  • Description modified (diff)
  • Priority changed from major to trivial
  • Status changed from new to needs_review
  • Type changed from defect to task
  • Work issues add doctest deleted

comment:4 Changed 6 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review
  • Type changed from task to enhancement


comment:5 Changed 6 years ago by vbraun

  • Branch changed from u/pbruin/17576-FreeModule_contains to 176e773ba68d3e56b91fb51c5ff20add97db5eaf
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.