简体   繁体   中英

unpickling HasTraits object: how to prevent assignment of certain traits

I have a HasTraits object which is written and read from disk using cPickle. The object has a certain trait that is computationally expensive to assign . From the traits documentation , I understand that all of the traits are being re-asigned when an object is read from disk.

I would like to prevent the expensive trait from being re-assigned when the object is read from disk. Is this possible?

如下所述,使此特征暂时变为: http : //docs.enthought.com/traits/traits_user_manual/advanced.html#persistence (BTW,请注意,这是比您链接的文档要新的版本,尽管本节内容在两个版本中。)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM