answered 9 years ago
Would this work?
sage: Partitions(4, max_part=2,inner=[2]).list() [[2, 2], [2, 1, 1]]