[Python-Dev] File Object Copy

Moshe Zadka Moshe Zadka <moshez@math.huji.ac.il>
Wed, 12 Jul 2000 10:21:08 +0300 (IDT)

On Wed, 12 Jul 2000, Peter Funk wrote:

> 'shutil.copyfile' however takes filenames as arguments and contains
> the loop sketched above as inline code.  I see two possibilities:
>   1. It would be easy to skip the open and close operations in 
>      'shutil.copyfile', if either 'src' or 'dst' are already open 
>      file objects instead of strings.  

-0: Too much Perl-like DWIM magic

>   2. Or you factor out the copy loop operation above and rename it into 
>      'copycontent' or 'copybytes' or whatever.

Of course it should be factored out: but the question remains, why shell
utils? Do you really think copybytes belongs there?
Moshe Zadka <moshez@math.huji.ac.il>
There is no GOD but Python, and HTTP is its prophet.