[Biopython-dev] Proposed addition to Standalone BLAST

Andrew Dalke dalke at acm.org
Tue Nov 7 18:55:40 EST 2000

>Another option is to allow people to pass in either a file name or a
>handle.  While I'm not crazy about this, there is at least one instance of
>this in Python (see uu.py), and tabnanny.py has a function that takes the
>name of either a file or directory.  Perhaps this is a case of
>practicality beating purity.

Guess I'm a purist. (Does that mean I should be using Lisp? :) 
Passing file handles is The Right Thing.

> That would allow people to use sys.stderr

Or a StringIO.  I have the belief that if there's output it should be
useful, and if it's useful, it should be programmatically accessible.
Using file names is awkward and cumbersome, since you have to find
some writable directory (eg, mktemp and all the problems that entails).

I'm currently working with a Python library which uses a lot of file
names instead of handle.  (It evolved from a set of shell scripts.)
It's pretty awkward since I have to wrap everything with functions or
objects which hide that it's referencing a file.

Otherwise, don't mind me - I haven't been following this thread.

                    dalke at acm.org

More information about the Biopython-dev mailing list