Jim Jeffries
Jim Jeffries

Reputation: 10081

Python C APi Deep Copy

How do I do a deep copy of a python object using the C API? I know I can use copy.deepcopy, but I'd prefer to use the C API if I can.

Upvotes: 4

Views: 865

Answers (1)

Sven Marnach
Sven Marnach

Reputation: 601789

The functionality of copy.deepcopy() is completely written in Python. I don't think they would have done this if there was a single C call to achieve the same thing, so my guess is you will have to call copy.deepcopy().

Upvotes: 4

Related Questions