Hi Maarten,

On 11 Sep., 21:12, Maarten Derickx <m.derickx.stud...@gmail.com>
wrote:
> can you check wether type(MyPolyRing).__reduce__() is actually called?

It isn't. I am currently trying to understand the "pickle" module. I
already found that it there is a special case when type(obj) is a
subclass of types.TypeType. That is the case here.

However, it is also the case of obj=QQ['x'].__class__: type(obj) is
<class 'sage.structure.dynamic_class.DynamicMetaclass'>, and that's a
subclass of type.

Hence, I don't understand why dynamic classes such as
QQ['x'].__class__ can be pickled, but my class can't.

Another detail, perhaps it is relevant. My metaclass is a dynamic
class and thus has a metaclass as well:
  sage: type(type(MyPolyRing))
  <class 'sage.structure.dynamic_class.DynamicMetaclass'>

Is there any restriction on metaclasses? That would be very surprising
for me, though. Shouldn't all be fine, if type(type(type(...
(type(obj))...))) arives at <type 'type'> after a finite number of
steps?

Best regards,
Simon

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to