methane
(Inada Naoki)
April 5, 2019, 1:38pm
21
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…)
pitrou
(Antoine Pitrou)
April 5, 2019, 1:52pm
22
Should be ascii=False
by default. Also I don’t know what the use case is for a pure-ASCII lower
.
1 Like
methane
(Inada Naoki)
April 6, 2019, 4:54am
23
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.
malemburg
(Marc-André Lemburg)
April 8, 2019, 10:09am
24
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.
barry
(Barry Warsaw)
April 9, 2019, 7:49pm
25
It should be a keyword-only argument!
1 Like
pitrou
(Antoine Pitrou)
April 9, 2019, 8:09pm
26
No, a positional-only argument!
malemburg
(Marc-André Lemburg)
April 10, 2019, 7:09am
27
No, a regular argument
Seriously, I think Barry is right. It makes the intended change in
semantics clear in applications.
1 Like
barry
(Barry Warsaw)
April 11, 2019, 12:11am
28
I think maybe Antoine was joking, given the recent decision on PEP 570 .
pf_moore
(Paul Moore)
April 11, 2019, 8:10am
29
This isn’t an argument, it’s just contradiction!
pitrou
(Antoine Pitrou)
April 11, 2019, 11:19am
30
It’s a contradiction-only argument.
2 Likes
malemburg
(Marc-André Lemburg)
April 11, 2019, 12:13pm
31
We may need the Argument Clinic to help here…
perhaps we’ll just call it the “5 minute argument”