Yelp / bravado-core

Other
109 stars 98 forks source link

Implement deepcopy support for Model instances #325

Closed sjaensch closed 5 years ago

sjaensch commented 5 years ago

It was reported internally that deepcopy doesn't work on model instances and fails with an infinite recursion exception. The test I'm adding failed without my change.

In doing a deep copy we should only copy the model properties, not the metadata set on the class. All of them are stored in the __dict attribute.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.1%) to 98.343% when pulling 047622a85a91c1e9124cde9ef0ae51a631acf3ca on sjaensch:deepcopy-for-models into 6790a9ab2b8b4ba92dd4c47a9043a37511171c63 on Yelp:master.

shrayus commented 5 years ago

Looks great! Thanks for fixing this so quickly :) Shipit!