Conversation
|
Very interesting idea! This would certainly solve many use cases very elegantly. I like it! Let's do it after 0.6 though. |
|
👍 |
|
It turns out that you can write |
There was a problem hiding this comment.
I think channels has to be removed here.
It should be obtained from data, like in the write() function.
There was a problem hiding this comment.
Same for overwrite() and accumulate(), of course.
I think this is just a matter of the API of I think those three "situations" are way too specialized (and I suspect too seldom used) to deserve three distinct top-level functions. If we expose
There is still an inconsistency with the argument Apart from all that, I'm still not convinced that any of this is necessary at all. I think such specialized convenience functions are only justified if they are used often and if they are used in interactive sessions. @faroit: It's really helpful to get feedback, thanks for that! |
There was a problem hiding this comment.
I don't like the repetition of those details. I would just refer to the function :func:write``.
|
We agreed to not do this. |
I'm glad that
__getitem__and__setitem__will be deprecated (see #75). I think that most of their functionality can be easily done with the other available functions and methods (and often in a better way).There is only one set of functions where indexing could be quicker (but not necessarily better) than the currently available options:
append(): open a file in'r+'mode, seek to the end, write a given array of data, close the file.overwrite(): open a file in'r+'mode, seek to a given position, write a given array of data, close the file.accumulate(): open a file in'r+'mode, seek to a given position, accumulate a given array of data to the data which is already in the file, close the file.Note that all of these only really make sense in
'r+'mode.Note also, that
append()is only a special case ofoverwrite().accumulate()is probably too specialized to deserve its own function and it's also my least favorite of the 3.I personally cannot imagine that I would ever need any of these, but if someone else needs them, I'm fine with supporting them.