Opened 8 years ago
Closed 8 years ago
#7403 closed enhancement (fixed)
adds FiniteEnumeratedSet
Reported by: | nthiery | Owned by: | hivert |
---|---|---|---|
Priority: | major | Milestone: | sage-4.3 |
Component: | combinatorics | Keywords: | finite enumerated sets |
Cc: | sage-combinat | Merged in: | sage-4.3.alpha0 |
Authors: | Florent Hivert | Reviewers: | Nicolas M. Thiéry |
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
This patch adds sage.sets.finite_enumerated_set.FiniteEnumeratedSet?
depends on #5891
Attachments (3)
Change History (10)
comment:1 Changed 8 years ago by
- Status changed from new to needs_review
comment:2 Changed 8 years ago by
- Status changed from needs_review to positive_review
Changed 8 years ago by
Changed 8 years ago by
comment:3 Changed 8 years ago by
- Status changed from positive_review to needs_work
Since it's not yet integrated, I take the chance to solve this stupid bug:
sage: FiniteEnumeratedSet([1]) {1,}
I'm re-uploading a patch with the following folded in
diff --git a/sage/sets/finite_enumerated_set.py b/sage/sets/finite_enumerated_set.py --- a/sage/sets/finite_enumerated_set.py +++ b/sage/sets/finite_enumerated_set.py @@ -123,8 +123,13 @@ class FiniteEnumeratedSet(UniqueRepresen sage: S = FiniteEnumeratedSet([1,2,3]) sage: repr(S) '{1, 2, 3}' + sage: S = FiniteEnumeratedSet([1]) + sage: repr(S) + '{1}' """ - return "{"+str(self._elements)[1:-1] + '}' + if len(self._elements) == 1: # avoid printing '{1,}' + return "{" + str(self._elements[0]) + '}' + return "{" + str(self._elements)[1:-1] + '}' def __contains__(self, x): """
Florent
Changed 8 years ago by
comment:4 Changed 8 years ago by
- Status changed from needs_work to needs_review
Please Nicolas (or anyone else re-view the small change.
Only trac_7403-finite-enumeratedsets-fh.3.patch should be applied on top of #5891
Cheers,
Florent
comment:5 Changed 8 years ago by
- Status changed from needs_review to positive_review
comment:6 Changed 8 years ago by
- Owner changed from mhansen to hivert
comment:7 Changed 8 years ago by
- Merged in set to sage-4.3.alpha0
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Apply only this one (ignore the next one)