|
From: Nicola L. <ni...@te...> - 2006-02-02 19:13:45
|
>> My preference would be the ability to specify a file object to >> cfg_obj.write(). > So you'd like to be able to pass a file like object to ``write()``... > hmmm... > > Again, this is something that you used to be able to do with ConfigObj > 3, but I removed to reduce the level of complexity. > > To be symmetric with initialisation, you ought then be able to pass in a > filename as well. Seeing as you can already achieve this just be setting > the ``filename`` attribute (which ok sounds a little weird for this > purpose), I decided not to do it. > > Hmmm... I guess it wouldn't hurt being able to pass an optional file > object to write, it's just that the API keeps growing... > > Nicola, do you have any take on this ? Well, it actually feels a little awkward that ConfigObj is in the business of opening files, and having to store the filename in an attribute. It seems best that ``write`` just receives a file-like object, and be done with it. This seems a worthy addition to me. At this point you probably have to keep the filename attribute for compatibility anyway, but maybe you could even find a way to deprecate it? :-) -- Nicola Larosa - http://www.tekNico.net/ Using threads is like having no backups: you stay in denial of the problem until it bites you, and then it's too late. -- Nicola Larosa, November 2005 |