Opened 6 years ago

Closed 6 years ago

#17133 closed defect (fixed)

Partition().to_exp() should return Sage Integers

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-6.4
Component: combinatorics Keywords:
Cc: Merged in:
Authors: Jeroen Demeyer Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: 24020fe (Commits) Commit: 24020fe82a0e23afac5d689e2954c58b33efa556
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

sage: e = Partition([2,1,1]).to_exp()
sage: e
[2, 1]
sage: [type(x) for x in e]
[<type 'int'>, <type 'int'>]

Note: as Volker points out in comment 1, there are more places with the same problem. Since this ticket is intended to avoid a doctest failure in #17130, I only fixed this one instance.

Change History (5)

comment:1 Changed 6 years ago by vbraun

Thats really a pattern that is all over the combinatorics stuff:

sage: iter(Partitions(4)).next()[0]
4
sage: type(_)
<type 'int'>

or

sage: g = SymmetricGroup(3).gen(0)
sage: type(g(1))
<type 'int'>

I've tripped more than once over this, its really common to want to do n.factorial() for some integer from a partition.

comment:2 Changed 6 years ago by jdemeyer

  • Description modified (diff)
  • Status changed from new to needs_review

comment:3 Changed 6 years ago by jdemeyer

  • Branch set to u/jdemeyer/ticket/17133
  • Created changed from 10/11/14 13:14:05 to 10/11/14 13:14:05
  • Modified changed from 10/11/14 13:56:34 to 10/11/14 13:56:34

comment:4 Changed 6 years ago by vbraun

  • Commit set to 24020fe82a0e23afac5d689e2954c58b33efa556
  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

New commits:

24020fePartition().to_exp() should return Sage Integers

comment:5 Changed 6 years ago by vbraun

  • Branch changed from u/jdemeyer/ticket/17133 to 24020fe82a0e23afac5d689e2954c58b33efa556
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.