Why aren't copy and deepcopy in __builtins__?

Carl Banks pavlovevidence at gmail.com
Mon Mar 28 00:32:07 EDT 2011


On Mar 27, 8:29 pm, John Ladasky <lada... at my-deja.com> wrote:
> Simple question.  I use these functions much more frequently than many
> others which are included in __builtins__.  I don't know if my
> programming needs are atypical, but my experience has led me to wonder
> why I have to import these functions.

I rarely use them (for things like lists I use list() constructor to
copy, and for most class instances I usually don't want a straight
copy of all members), but I wouldn't have a problem if they were
builtin.  They make more sense than a lot of builtins.

I'd guess the main reason they're not builtin is that they aren't
really that simple.  The functions make use of a lot of knowledge
about Python types.  Builtins tend to be for straightforward, simple,
building-block type functions.


Carl Banks



More information about the Python-list mailing list