I have a nested class:
class WidgetType(object):
class FloatType(object):
pass
class TextType(object):
pass
.. and
In Sage (www.sagemath.org), we have many instances of this pickling issue. The way we decided to systematically solve it is to put the outer class inside a specific metaclass whose goal is to implement and hide the hack. Note that this automatically propagate through nested classes if there are several level of nesting.