On consistency of definition of "line"(separator) in str standard library, and some more ideas

yes it’s historically poorly defined, together with (but originating from earlier than) unicode…

just be short, in the standard library, currently functions involving the concept of “line” has got inconsistency:

  • str.splitlines treats a big set of chars/sequences as line separator, but
  • str.expandtabs only recognizes \r \n \r\n to reset counter

to make them behave consistently, or to further clarify the difference in the docs? and what about potentially future standard functions involving “lines”? additional argument to choose behavior?

more, iterator version as mentioned here?

btw: is there possibility to let expandtabs behave like elastic tabstops under specific arguments? (for example, -n for n padding of spaces (minimal being 1))