I cannot the vote because of time limit. So I repost it.
I want to poll about d-string vs __future__ import.
__future__ import changes syntax of triple quote string literal like proposed d-string.
- d-string makes string prefix more complex.
- E.g.
d/D/df/dF/DF/Df/fd/fD/FD/Fd/dt/dT/DT/Dt/td/tD/TD/Td/ud/... - But it doesn’t break backward compatibility in the future.
- E.g.
__future__import doesn’t need new prefix.- It changes all triple quote literals.
- It will break backward compatibility in the future. But it will make language simple.
- Tools like pyupgrade would help the transition.
str.dedent()is the most simple option.- But it cannot work nicely with t/f-string.
- People want to use t-string for HTML or SQL. And they want to dedent it too.
- It cannot work nicely with line continuation too.
- Vote to d-string or
__future__import if you want both of dedenting literal andstr.dedent()- Because we are discussing about literal improvement is necessary or not.
- But it cannot work nicely with t/f-string.
- Add d-prefix to string literal
__future__import changes triple quote literal to auto dedent- Add
str.dedent()and never add d-string nor__future__import. - Status quo; never add any.
0
voters