This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author maker
Recipients JBernardo, eric.araujo, maker, rhettinger, sbt, serhiy.storchaka, terry.reedy
Date 2012-10-03.16:07:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1349280433.96.0.0016439329626.issue13290@psf.upfronthosting.co.za>
In-reply-to
Content
> The patch does not seem to walk the mro to look for slots in base 
> classes.  Also, an instance with a __dict__ attribute may also have 
>attributes stored in slots.
Well, what I am doing is more or less the equivalent of 

return object.__slots__ if hasattr(object, '__slots') else object.__dict__

and this is coherent with the updated documentation. The one you proposed is an alternative behavior; am I supposed to follow that one?

>
> BTW, copyreg._slotnames(cls) properly calculates the slot names for cls and tries to cache them as cls.__slotnames__.  Pickle does the equivalent of
>
>     try:
>         slotnames = cls.__slotnames__
>     except AttributeError:
>         slotnames = copyreg._slotnames(cls)
thanks! I'll take into account. 

-- 
ù
History
Date User Action Args
2012-10-03 16:07:14makersetrecipients: + maker, rhettinger, terry.reedy, eric.araujo, sbt, JBernardo, serhiy.storchaka
2012-10-03 16:07:13makersetmessageid: <1349280433.96.0.0016439329626.issue13290@psf.upfronthosting.co.za>
2012-10-03 16:07:13makerlinkissue13290 messages
2012-10-03 16:07:13makercreate