[issue36628] Enhancement: i-Strings
New submission from Aditya Shankar : Problem: multiline strings are a pain to represent (other than of-course in docstrings), representing a multiline string inside a function looks something like this - def foo(): # some code ... ... # some code text = """abc meta alpha chronos dudes uptomes this text is nonsense""" return somethingwith(text) or def foo(): # some code ... ... # some code text = "\n".join(["abc meta alpha chronos", "dudes uptomes this text", "is nonsense"]) return somethingwith(text) an enhancement would be - def foo(): # some code ... ... # some code text = i""" abc meta alpha chronos dudes uptomes this text is nonsense """ return somethingwith(text) i.e. all initial spaces are not considered as a part of the string in each ine for example while throwing an exception - def foo(bad_param): ... try: some_function_on(bad_param) except someException: throw(fi""" you cant do that because, and I'm gonna explain this in a paragraph of text with this {variable} because it explains things more clearly, also here is the {bad_param} """) ... which is far neater than - def foo(bad_param): ... try: some_function_on(bad_param) except someException: throw(f"""you cant do that because, and I'm gonna explain this in a paragraph of text with this {variable} because it explains things more clearly, also here is the {bad_param}""") ... pros: - represented code is closer to output text - implementation should not be too hard -- components: Interpreter Core messages: 340208 nosy: Aditya Shankar priority: normal severity: normal status: open title: Enhancement: i-Strings type: enhancement versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue36628> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36628] Enhancement: i-Strings
Change by Aditya Shankar : -- resolution: postponed -> duplicate ___ Python tracker <https://bugs.python.org/issue36628> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36200] display index on Index
Change by Aditya Shankar : -- nosy: Aditya Shankar priority: normal severity: normal status: open title: display index on Index ___ Python tracker <https://bugs.python.org/issue36200> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36200] display index on IndexError
Change by Aditya Shankar : -- components: +Interpreter Core title: display index on Index -> display index on IndexError type: -> enhancement versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issue36200> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36200] display index on IndexError
New submission from Aditya Shankar : considering a list of 5 elements, if the 6th element is asked, the Interpreter would raise IndexError: list index out of range, I think It'd be better if it actually said what the invalid index is Improvement benefits: *quicker debugging of faulty python code *person debugging does not need to edit and restart the program to fix issue, sometimes at least -- ___ Python tracker <https://bugs.python.org/issue36200> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36200] display index on IndexError
Aditya Shankar added the comment: closed as this is a duplicate for https://bugs.python.org/issue18162 -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue36200> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com