# PEP 822: Dedented Multiline String (d-string)

**URL:** <https://discuss.python.org/t/pep-822-dedented-multiline-string-d-string/105519>\
**Category:** PEPs\
**Created:** [January 5, 2026, 11:18am UTC](https://discuss.python.org/t/pep-822-dedented-multiline-string-d-string/105519 "2026-01-05T11:18:19Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![methane](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/methane/32/43_2.png) [@methane](https://discuss.python.org/u/methane)\
**Post date:** [January 6, 2026, 8:48am UTC](https://discuss.python.org/t/pep-822-dedented-multiline-string-d-string/105519/10 "2026-01-06T08:48:26Z")

</div>

I explained in a previous thread why I think it’s better to strip the newline immediately after the opening quotes but leave newline in the last line.

> [@Pre-PEP: d-string / Dedented Multiline Strings with Optional Language Hinting](https://discuss.python.org/t/pre-pep-d-string-dedented-multiline-strings-with-optional-language-hinting/90988/124):
>
> ```python
> s = d"""
> one
> two
> three
> """
> assert s == "one\ntwo\nthree\n"
> 
> ```
> 
> This string looks three **lines**. And **line** in POSIX includes terminal newline. ([ref](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206))
> 
> rstrip or backslash is ugly. But it is rarely used, only for creating ugly multiline string.  
> Of course this is my subjective opinion.

---

_[View the full topic](https://discuss.python.org/t/pep-822-dedented-multiline-string-d-string/105519)._
