Re: Looking for ideas to improve library API

2015-11-28 Thread Devin Jeanpierre
Documentation is all you can do. -- Devin On Thu, Nov 26, 2015 at 5:35 AM, Chris Lalancette wrote: > On Thu, Nov 26, 2015 at 7:46 AM, Devin Jeanpierre > wrote: >> Why not take ownership of the file object, instead of requiring users >> to manage lifetimes? > > Yeah, I've kind of been coming to

Re: Looking for ideas to improve library API

2015-11-26 Thread Chris Lalancette
On Thu, Nov 26, 2015 at 7:46 AM, Devin Jeanpierre wrote: > Why not take ownership of the file object, instead of requiring users > to manage lifetimes? Yeah, I've kind of been coming to this conclusion. So my question then becomes: how do I "take ownership" of it? I already keep a reference to

Re: Looking for ideas to improve library API

2015-11-26 Thread Chris Lalancette
On Thu, Nov 26, 2015 at 7:36 AM, MRAB wrote: > Why pass a file descriptor? Why not a filename? The reason for a file descriptor is so that I can also add other file-like objects, such as StringIO. My unit tests, for instance, rely heavily on this. That being said, it is not *strictly* required

Re: Looking for ideas to improve library API

2015-11-26 Thread Devin Jeanpierre
Why not take ownership of the file object, instead of requiring users to manage lifetimes? -- Devin On Wed, Nov 25, 2015 at 12:52 PM, Chris Lalancette wrote: > Hello, > I'm currently developing a library called pyiso ( > https://github.com/clalancette/pyiso), used for manipulating ISO disk

Re: Looking for ideas to improve library API

2015-11-26 Thread MRAB
On 2015-11-25 20:52, Chris Lalancette wrote: Hello, I'm currently developing a library called pyiso ( https://github.com/clalancette/pyiso), used for manipulating ISO disk images. I'm pretty far along with it, but there is one part of the API that I really don't like. Typical usage of

Looking for ideas to improve library API

2015-11-26 Thread Chris Lalancette
Hello, I'm currently developing a library called pyiso ( https://github.com/clalancette/pyiso), used for manipulating ISO disk images. I'm pretty far along with it, but there is one part of the API that I really don't like. Typical usage of the library is something like: import pyiso p