[Python-Dev] Implementing (parts of) copy module in C

Victor Stinner victor.stinner at gmail.com
Wed Nov 2 06:54:59 EDT 2016


Hi,

2016-11-01 22:56 GMT+01:00 Rasmus Villemoes <rv at rasmusvillemoes.dk>:
> I'm using (and contributing to) an application which spends a
> significant part of its startup time calling copy.deepcopy, so I thought
> I'd try to write a C extension to speed this up.

Maybe you should consider another option: using copy.dpeecopy() is
*bad* practice and should be avoided in almost all cases.

By design, copy.deepcopy() cannot be efficient.

For efficient code, you should redesign the application to use
immutable structures for example.

Victor


More information about the Python-Dev mailing list