2

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
  • 23,452
  • 27
  • 113
  • 201

1 Answers1

4

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
  • 260,549
  • 28
  • 431
  • 505
  • 3
    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