[Zope3-dev] zope.filerepresentation.interfaces.IWriteFile

Christian Theune ct at gocept.com
Fri Sep 29 02:53:36 EDT 2006


Hi,

as I stumbled over this recently, I'd like to bring this up for discussion:

There is an interface called IWriteFile in the module
zope.filerepresentation.interfaces.

It defines one method "write(data)" with the doc string:

"Update the file data"

There are some problems I have with this:

a) The interface is yet another interface for doing a file-like object.
How many of those are around?

b) It *seems intended* not to be really file-like but that "update the
file data" means: writing to this will replace all previous data

c) The doc string is IMHO underspecified (I asked 3 other developers in
the office. One of them said "it will replace the data on the second
call", one said "it will append data like the file object", the third
wasn't sure but was in favor of appending data)

This interface is used only in very few places in Zope.

I'm not sure what to do now, but I think something needs to be changed.
Here are some options:

- Make the doc string more explicit. (That should happen anyway)
- Keep the current behavior.
- Change the current behavior and make write() act like Python's
  file.write()

Christian

PS: This is yet another example where we end up with an API that we
declared stable without sufficient exposure IMHO.

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20060929/a023a169/signature.bin


More information about the Zope3-dev mailing list