Current polling result:
- Improve something or not: 42 vs 5. About 90% people are +1 on improve multiline string usability!
- Improve syntax or not: 33 vs 14. About 70% people are +1 on improve syntax.
- But this result may not include
Template.dedent()idea.
- But this result may not include
- d-string vs
__future__: 21 vs 12. About 63% people against__future__.- I still like
__future__idea, but I have abandoned it.
- I still like
Previous poll is still open, but I want to open next poll:
Improve syntax vs add method?
- d-string or triple-quote
- str.dedent and Template.dedent
0
voters
If improve syntax, d-prefix or triple backquote (```)?
- d-string
- triple backquote
0
voters
Note for options:
-
- d-string
- new combination of string prefixe.
- no new symbol in syntax.
- support dedenting line continuation.
- remaining indent can be specified by closing quote.
-
- triple backquote (
```)
- doesn’t increase combination of string prefix.
- but using new symbol.
- other characteristics are the same as for d-string.
- triple backquote (
-
str.dedent()andTemplate.dedent()
- no new syntax rule is needed at all.
- cannot dedent line-continuation.
- f-string.dedent() and t-string.dedent() looks similar but behavior is different.
- f-string.dedent() behavior would be pitfall
- f-string.dedent() cannot be done at compile time.
- remaining indent should be specified as argument. (e.g.
dedent(indent=4),dedent(indent=' '*4), `dedent().indent(’ '*4), etc…)