bdesham
bdesham

Reputation: 16089

Should I be using shutil.copytree?

The documentation for the copytree function in the Python 2 version of shutil says,

The source code for this should be considered an example rather than the ultimate tool.

Exactly what does this mean? Is copytree intended to be a proof of concept instead of actually being used in programs? Or is this just a disclaimer that the code is messy? (This statement is not present in the Python 3 version.)

Upvotes: 3

Views: 122

Answers (1)

Simeon Visser
Simeon Visser

Reputation: 122376

In earlier versions of the shutil code it had this note (introduced by Guido):

XXX Consider this example code rather than the ultimate tool.

This note was then removed in this commit. So there doesn't seem to be a specific reason for that note, other than that the code has organically grown from not-quite-ready to supports-what-we-need.

Upvotes: 3

Related Questions