Opened 5 years ago

Closed 4 years ago

#8543 closed defect (fixed)

EmptySet is Back ! TestSuite should allows for empty sets.

Reported by: hivert Owned by: hivert
Priority: major Milestone: sage-4.4
Component: categories Keywords: empty set, Testsuite, EmptySetError
Cc: nborie, sage-combinat Merged in: sage-4.4.alpha0
Authors: Florent Hivert Reviewers: Nicolas Borie, Nicolas M. Thiéry
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by hivert)

There is currently no way to have an empty set which pass the category tests. Indeed the current specification says: for any set S there must be a method S.an_element() which returns an actual element x such that x in S:

an_element = self.an_element()
tester.assert_(an_element in self, "self.an_element() is not in self")

This tests should allows S to be empty.

To solve this issue I added a new exception called EmptySetError which should be raised in such cases. I fixed the tests suite of the category Sets() accordingly and expanded the test in some places where this could be done before.

Depends on #8519

Attachments (2)

trac_8543-empty_set_categories-fh.patch (5.9 KB) - added by hivert 5 years ago.
trac_8543-empty_set_categories-review-nt.patch (4.2 KB) - added by nthiery 4 years ago.

Download all attachments as: .zip

Change History (10)

Changed 5 years ago by hivert

comment:1 Changed 5 years ago by hivert

  • Description modified (diff)
  • Keywords EmptySetError added
  • Status changed from new to needs_review
  • Summary changed from EmptySet is Back ! to EmptySet is Back ! TestSuite should allows for empty sets.

comment:2 Changed 5 years ago by nborie

  • Reviewers set to Nicolas Borie
  • Status changed from needs_review to positive_review

Patches from #8519 your patch apply fine on 4.3.4
All tests passed for each touched files, doc is OK too. This another empty problem is fixed...

Thanks for fixing this!

I give this patch a positive review...

comment:3 Changed 4 years ago by nthiery

  • Status changed from positive_review to needs_work

Nicolas: thanks for your review!

Florent: I made a quick reviewer patch fixing some trivial things. Please double check, and set back the positive review!

comment:4 Changed 4 years ago by nthiery

  • Status changed from needs_work to needs_review

comment:5 Changed 4 years ago by nthiery

  • Cc sage-combinat added

comment:6 Changed 4 years ago by nthiery

  • Reviewers changed from Nicolas Borie to Nicolas Borie, Nicolas M. Thiéry

comment:7 Changed 4 years ago by hivert

  • Status changed from needs_review to positive_review

The new changes are good to me => positive review.

comment:8 Changed 4 years ago by jhpalmieri

  • Merged in set to sage-4.4.alpha0
  • Resolution set to fixed
  • Status changed from positive_review to closed

Merged in 4.4.alpha0:

  • trac_8543-empty_set_categories-fh.patch
  • trac_8543-empty_set_categories-review-nt.patch
Note: See TracTickets for help on using tickets.