String and function esthetics #16375
Unanswered
jean-claudeF
asked this question in
Using MicroPython
Replies: 4 comments
|
Only in a different way clumsy: |
0 replies
|
Yeah I personally agree it's pretty ugly like this. Often I define my multiline strings at global context just to avoid this. Alternatively: |
0 replies
|
In CPython you'd typically use the standard library def test():
s = dedent("""\
blahblah
blahblah
blahblah
""")
print(s)assuming you were willing to pay the runtime cost. But apparently That said, if it's constant do what @andrewleech suggested and make it a module-level string. |
0 replies
|
I use global variables now at module level, that seems to me the most elegant solution. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I love the clear structure of Python.
One thing however hurts my feelings.
Example:
This is not beautiful.
For me the whole string definition should be indented.
Is there a way to do it more elegantly?
All reactions