moshe wrote: > > > 1. It would be easy to skip the open and close operations in=20 > > > 'shutil.copyfile', if either 'src' or 'dst' are already open=20 > > > file objects instead of strings. =20 > >=20 > > -0: Too much Perl-like DWIM magic footnote: it's definitely an accepted pydiom: aifc.py: if type(f) =3D=3D type(''): f =3D __builtin__.open(f, 'rb') binhex.py: if type(ofp) =3D=3D type(''): ofname =3D ofp ofp =3D open(ofname, 'w') mimify.py: if type(infile) =3D=3D type(''): ifile =3D open(infile) pstats.py: elif type(arg) =3D=3D type(""): f =3D open(arg, 'rb') etc. it's a reasonable way to make your code a bit more reusable (it's rude to expect every chunk of potentially usable data to have a filename...). </F>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4