Hey everyone, The following gives a PicklingError: sage: P = Partitions(5, max_length=4) sage: loads(dumps(P))
The actual object created in an instance of `IntegerListsLex`, and the pickling error is due to the fact that the global options `PartitionOptions` cannot pickled since it passes lambda functions as parameters. The ParittionOptions cannot be pickled is okay IMO since there is a unique such global object in Sage. However, this causes problems when creating partitions with constraints (for my purposes, I need all partitions of a bounded max length). The solution is to create a new class which has class attributes at least for the global options, in fact I'd also give it an `Element` as well (and perhaps inherit from `Partitions` -- I haven't tried that yet to see if things break): class Partitions_constraints_new(IntegerListsLex): Element = Partition global_options = _Partitions.global_options So I have a few questions about this right now. Do we want to still keep backwards compatible unpickling of (very) old `Partitions_constraints` (below sage-3.4.1), and if so, what should we call this new class? Do we want to be able to pass things like NN to `Partitions` (and use this class) and/or continue to allow `IntegerListsLex` to vary over a range of n? Here's my opinion: I think we should drop the unpickling of these very old objects. We should not allow `IntegerListsLex` to range over n, and instead use `DisjointEnumeratedSet`. Subsequently we should allow NN to be passed to `Partitions` and have that return a `DisjointEnumeratedSet` of the respective objects. I'd create the first ticket which fixes the pickling error above and replaced `Partitions_constraints` with my proposed class above. Best, Travis PS - More bad puns to follow :P -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-combinat-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/groups/opt_out.