mozman / ezdxf

Python interface to DXF
https://ezdxf.mozman.at
MIT License
912 stars 191 forks source link

enable pickle entity #1111

Closed GoatWang closed 3 months ago

GoatWang commented 3 months ago

Enable pickling entity. Since the circular reference of entity.dxf and dxf._entity, causing the fail pickling. To address this, _entity attribute of entity.dxf will be removed before pickle.dump and will be rewired when pickle.load. Also, test function is added to valid the feature.

mozman commented 3 months ago

I don't see any need to support the pickle protocol, and I'm not sure if this won't create more problems than it solves.

The DXF structures have many and often deep linkage, just testing with DXFEntity is not sufficient. Test your code with HATCH or MLEADER entities.