Ticket #12278 (new defect)
misleading (outdated) docstring in partitions_restricted
|Reported by:||AlexGhitza||Owned by:||sage-combinat|
Description (last modified by andrew.mathas) (diff)
The docstring for partitions_restricted says that the function is deprecated and one should instead use RestrictedPartitions. However, this also turns out to be deprecated. It would be good to fix this.
And here is a more serious problem: the way that is now recommended for obtaining the list of restricted partitions is Partitions(n, parts_in=S). However, Partitions cannot have both parts_in and length specified, so not all the functionality of the old partitions_restricted remains available.
Update: Following this discussion on sage-combinat, it has been agreed that the functionality of RestrictedPartitions? should be fully implemented in Partitions by allowing the combination of different keyword argument. The problem with the current implementation is already highlighted in the documentation for Partitions():
Right now, the "parts_in", "starting", and "ending" keyword arguments are mutually exclusive, both of each other and of other keyword arguments. If you specify, say, "parts_in", all other keyword arguments will be ignored; "starting" and "ending" work the same way.
The code should allow keywords to Partitions() to be used in any way that makes sense. In particular, it is not currently possible to combine the arguments parts_in and max_length, for example. For this reason RestrictedPartition?() has not been deprecated yet. Note, however, that RestrictedPartitions is essentially a wrapper to gap function call, which makes it quite slow. In contrast, the use of parts_in is quite quick.