1

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

Gulzar
  • 17,272
  • 18
  • 86
  • 144

1 Answers1

3

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.

user2357112
  • 235,058
  • 25
  • 372
  • 444
  • 2
    Could you elaborate please on why these functionalities considered of different abstraction levels? This is the first time i heared this, don't even know what to google. – Gulzar Oct 25 '20 at 13:50