[issue39863] Add trimend option to readline() and readlines()

2020-03-05 Thread Inada Naoki
Inada Naoki added the comment: > It would be better to name it keepends and set it True by default. .readline() returns only one line. Should we use plural form for consistency? > It is also not good for file-like classes which do not inherit IOBase, but > implement a part of methods. You c

[issue39863] Add trimend option to readline() and readlines()

2020-03-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It would be better to name it keepends and set it True by default. I wanted this feature. The problem is that it is not just concrete implementation, it is an interface. Adding new parameters for IOBase methods will break all IOBase subclasses. And there a

[issue39863] Add trimend option to readline() and readlines()

2020-03-05 Thread Inada Naoki
New submission from Inada Naoki : str.splitlines() has `keepends` option. Like that, `IOBase.readline([trimend=False])` and `IOBase.readlines([trimends=False])` would be useful. -- components: IO messages: 363430 nosy: inada.naoki priority: normal severity: normal status: open title: A