Why is there no os.copy() under the standard os module?

Viewed 430

Python's os module has .remove, .rename, and other file-related functions.

Why is there no support for .copy?

I found how to copy a file in Python? and it seems shutil is the go-to library.


I was wondering about the process that led to the decision not to include a basic file copy in os

1 Answers

The os module was designed to hold OS-level functionality, and "copy" isn't OS-level functionality. Stuff like os.remove, os.rename, etc. correspond to low-level filesystem operations, while "copy" is a much higher-level operation.

Related