|
From: Fuzzyman <fuz...@vo...> - 2006-02-03 10:33:54
|
Aaron Bentley wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Michael Foord wrote: > | I realise that in Python it is more common to pass around file like > | objects than filenames. I guess this is more object oriented because of > | the "like" bit. However it has always felt more awkward to me, because > | >90% of the time I use "file-like" objects, they are file objects. > > For Bazaar-NG, the file-like objects currently represent http, sftp and > ftp downloads and uploads. Not saying either way is best, or even that > you have to change things. What we have now does work, after all, and I > appreciate the changes you've made so far. > Thanks for your comments. Fixes discussed so far will be ready over the weekend. I *do* think it's weird that ConfigObj uses the filename attribute to store a reference to the file object/StringIO instance you pass in. This is illogical at best, and can lead to errors if you would normally expect a file object to be garbage collected. (It's better practise to close explicitly, but hey.) I think the best change is to *not* store a reference to "file-like-objects" passed in to ConfigObj, but change the ``write`` method to receive an optional file object as an argument. This is backwards incompatible - but because of all the changes I'm bumping the version number to 4.2.0. I'm open to protests from anyone else before I make this change... All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > Aaron > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (GNU/Linux) > Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org > > iD8DBQFD4rOU0F+nu1YWqI0RAudeAJ0fnGEecu5wVMNyLa4UiWyJ1ft5gQCfbEq+ > 49JZmbgE0HaX8AtpzA6Jn9Q= > =RNuq > -----END PGP SIGNATURE----- > |