[Biopython-dev] [Bug 2711] GenomeDiagram.py: write() and write_to_string() are inefficient and don't check inputs
bugzilla-daemon at portal.open-bio.org
bugzilla-daemon at portal.open-bio.org
Tue Jan 6 12:30:39 UTC 2009
http://bugzilla.open-bio.org/show_bug.cgi?id=2711
------- Comment #23 from biopython-bugzilla at maubp.freeserve.co.uk 2009-01-06 07:30 EST -------
(In reply to comment #22)
> That is great!
>
> Note that reportlab's drawToString first uses it's getStringIO() and passes
> that to drawToFile. I am not sure the difference between getStringIO() and
> StringIO() but getStringIO() might be preferred.
>From going through the ReportLab code a week or two ago, it ends up using
cStringIO (or falling back on StringIO) internally.
> Also, I would presume that checking for the filename would allow you to
> combine the writing to a file and writing to a string into a single new
> function to maintain backwards compatibility.
You'd then have one method to write to a string, handle or filename. As I said
before, I'm not keen on this - having two very different return values (string
or nothing) depending on the arguments, with some special invocation needed to
request the string output (maybe None rather than a filename/handle?).
The status quo seems OK here, with a write method (to a handle or filename) and
separate a write_to_string method.
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Biopython-dev
mailing list