D-string vs str.dedent() - Ideas - Discussions on Python.org
Oct 11, 2023 ... I'm not sure that adding yet another string prefix or making dedent the default for triple-quoted strings is a good idea. The case for doc- ...
Oct 11, 2023 ... I'm not sure that adding yet another string prefix or making dedent the default for triple-quoted strings is a good idea. The case for doc- ...
Oct 17, 2023 ... For these reasons, trailing spaces are removed in triple-quoted string literals in Java (where they are called text blocks). Should Python ...
MIT and the University of Washington maintain explicit Java-to-Python method mapping tables for students. List.add(e) → list.append(e), toLowerCase → lower, indexOf → find.
Apr 9, 2023 ... And they have methods, which are “function attributes” if you like: binary = x.to_bytes(4, "big") # is the bit string b'\x00\x01\xa2\xb3'.
Maybe because % is the only string formatting method supported by many programming languages, unlike the newer formatting styles that have become trendy recently: Python (f""), Ruby (#{}), Swift (\()), JavaScript (Hello, ${name}).
Feb 24, 2025 ... These would be part of the unicode-escape encoding, which is used by both the Python parser and the codecs.decode() function. See this example ...
Discussions on Python.org. Safer logging methods for f-strings and new-style formatting.Logging f-strings is quite popular, but is potentially unsafe with the current logging methods. There are different ways to solve this problem – while keeping new-style formatting.
Feb 11, 2023 ... I propose adding an annotation to document exceptions that are explicitly raised within the function ... Something like a documentation string or ...
Old threads: Str.dedent vs str.removeindent D-string vs str.dedent() Markdown code-block style syntax for string lite…It is totally different. String methods doesn’t know where string came from (e.g. multiline string literal, regular string litera, other expressions, read from file…).
Jul 26, 2021 ... But having said that, embedding chunks of SQL in code as strings is another use case, and it's definitely something you see in C/C++, Java, etc.
May 9, 2025 ... tl;dr Java has virtual threads. Virtual threads are a better way of doing concurrency than Python's async and await. We should add virtual ...