On Tue, Jul 13, 2021 at 10:27:55PM +0300, Serhiy Storchaka wrote:
The writelines method is the part of interface. Adding new parameter or new method to interface is a major breaking change. It will make invalid all existing user code which implements this interface.
I think that statement is a bit strong. How will it break existing code? The code will still work exactly the same as before. We added the BufferedIOBase.readinto1 method in Python 3.5, before that we added 'x' mode and `opener=None` parameter to FileIO in 3.3. https://docs.python.org/3/library/io.html#io.BufferedIOBase.readinto1 https://docs.python.org/3/library/io.html#io.FileIO In 3.7 we allowed the BytesIO.read1 size parameter to be optional: https://docs.python.org/3/library/io.html#io.BytesIO.read1 There are other changes to the IO interfaces through to Python 3.7. If that didn't break code, I don't see why this change would. I think that adding a new method or a keyword-only arg to writelines in 3.11 would be fine. -- Steve