Nicolas, > This __main__ trick is only for when you define python > functions "interactively" (e.g. in doctests), and you want to fake > them being picklable for TestSuite's pickling tests.
Yes, but there are cases in which it is desirable for the code to create pure "orphan" functions, say, to help create morphisms. These morphisms will NOT pass pickling. And this is apparently enough for one's patch to be given the thumbs-down by the code barons, and perhaps rightfully so. Example. When constructing a tensor product of module morphisms, due to some existing "optimizations" like automatic flattening of nested tensors and this tensor-unit business, in order to create reasonably efficient tensor product maps, I feel it is necessary and hightly convenient to manufacture, on the fly, a pure "orphan" function as an "on_basis" function to feed to module_morphism. There is no natural "home" for such functions, which are somewhat complicated and are created each time someone wants to tensor some morphisms. It makes no sense for these functions to be lexically tethered somewhere, which is what the pickling seems to require. --Mark -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
