D-string vs str.dedent() - Ideas - Discussions on Python.org
Oct 11, 2023 ... The newline is not included in the string. d"spam" and d'''egg''' are syntax error. d-string ends with indent and triple quote ...
Oct 11, 2023 ... The newline is not included in the string. d"spam" and d'''egg''' are syntax error. d-string ends with indent and triple quote ...
Currently, Python lacks a path to explicitly declare structural typing without inheriting methods. This is a genuine gap in the affordances provided Python’s typing system, and without it, IMO, Python can’t fully cash out on structural typing.
Apr 9, 2023 ... The RFC is for how I've coded this and is it a good example of, not only how to code a Class, but also the usage of said. This is my first ...
Source code: Lib/string.py String constants: The constants defined in this module are: Custom String Formatting: The built-in string class provides the ability to do complex variable substitutions ... Oh, and the colon marks the start of the format spec: [":" format_spec].
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 ...
I use and rely on syntax highlighting, but what about visually impaired programmers or other folks for which highlighting might not help or be available? I do think it gets worse with nested f-strings, as in this PEP example
Mar 14, 2023 ... I think of them as separate methods (which they would be in e.g. Java) but in Python they're overloads on a single method. ... The code sample ...
First, regarding Unicode syntax errors for bad escape sequences. Python up to 3.8 gives (yes, I’m using a common Windows gotcha for testing on Linux): $ python3.8 -c "data = 'C:\Use…
Oct 5, 2023 ... But taking the example of Swift, one of the major reasons (I believe) it places such emphasis on nil-aware operators is for interoperability ...
Code inside f-strings may not be colourized, or if it is, the colourizer surely won’t include a full blown Python parser. So it will likely colour the first example as a comma-separated pair of strings: f"These are the things: {" COMMA ".join(things)}".
Apr 2, 2019 ... …then the generator's caller's code ends up running in between the calls to __(a)enter__ and __(a)exit__ , and this corrupts the concurrency ...