[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환
김준환 added the comment: x does not change. sorry. I also haven't figured out the implementation in my head yet. I want to provide some functionality to provide consistent indentation while using formatting . For example """ test {multi_line_text} "

[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환
김준환 added the comment: Sorry, Can't edit comments Please see the code example below ``` Class A: def get_something_string(): return textwrap.dedent("""\ test text2 test text3 test text4""") textwrap.dedent(f"""\

[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환
김준환 added the comment: No, I know `textwrap.dedent` as a convenience function used for code readability. But to have the result I want, I currently need to do something like this: If it's a method inside a class, it's even more ugly. Class A: def get_something_string():

[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환
김준환 added the comment: "<<" This marks that line. ignore it -- ___ Python tracker <https://bugs.python.org/issue46992> ___ ___ Python-bugs-list ma

[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환
김준환 added the comment: If it's only for version 3.11, what do you think of the default behavior of the dedent method being changed? The method description says: > Remove any common leading whitespace from every line in `text`. ``` def get_something_string(): return textwra

[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환
김준환 added the comment: Sorry, it's an indent , not an intent . -- ___ Python tracker <https://bugs.python.org/issue46992> ___ ___ Python-bugs-list m

[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-11 Thread 김준환
New submission from 김준환 : If use textwrap.dedent with string formatting, may get unintended sentences. For example, a sentence like this: ``` import textwrap def get_something_string(): return textwrap.dedent("""\ test text2 test text3