3

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.)

bdesham
  • 15,430
  • 13
  • 79
  • 123
  • 1
    I read it to mean that the code works but the implementation is messy enough that it is not held up as an example. – hughdbrown Aug 19 '14 at 15:07

1 Answers1

3

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.

Simeon Visser
  • 118,920
  • 18
  • 185
  • 180
  • Yes, there are many examples of some statement getting added to the docs back in the 90's, it eventually gets stale, but is simply overlooked for years until someone finally notices and fixes it. See [this question](http://stackoverflow.com/q/24831458/2073595) for another example. – dano Aug 19 '14 at 15:25