Changing str.splitlines to match file readlines

I want to fix this in Python 3.8. Let’s decide API!
Which API design do you prefer?

  • keyword (e.g. .splitlines(ascii=True), .strip(ascii=True), .lower(ascii=True), etc…)
  • ascii_ methods (e.g. .ascii_splitlines(), .ascii_strip(), ascii_lower(), etc…)

0 voters

Should be ascii=False by default. Also I don’t know what the use case is for a pure-ASCII lower.

1 Like

Of course, I meant how to call it, not signature. Sorry for confusing.

This poll is about naming convention for ascii variants methods.

I don’t know ASCII variants of lower() will be added in the future.
But when it is added, same naming convention should be used.

ascii=True would have them methods return strict ASCII only mappings, i.e. not map non-ASCII Unicode chars to lower case variants.

Something that needs to be discussed is locale awareness of the methods. In Python 2, they are locale aware and not strictly ASCII only. The Unicode methods in Python 2 and 3 are not locale aware.

It should be a keyword-only argument!

1 Like

No, a positional-only argument!

No, a regular argument :slight_smile:

Seriously, I think Barry is right. It makes the intended change in
semantics clear in applications.

1 Like

I think maybe Antoine was joking, given the recent decision on PEP 570. :wink:

This isn’t an argument, it’s just contradiction!

It’s a contradiction-only argument.

2 Likes

We may need the Argument Clinic to help here…

perhaps we’ll just call it the “5 minute argument” :wink: