Lazy load of strings - Ideas - Discussions on Python.org
May 11, 2025 ... ... code writing docs and PEPs is a large challenge. That is why I started with the sample PEP this time even though it takes me twice as long ...
May 11, 2025 ... ... code writing docs and PEPs is a large challenge. That is why I started with the sample PEP this time even though it takes me twice as long ...
Oct 11, 2023 ... It is possible to specify the amount of indentation to remove on the final line of the string. This idea is ported from Swift. See Documentation.
For example Java’s finalize method was deprecated since Java 9, but “deprecated, for removal” since Java 18. Also, my question remains: if something is good enough not to be deprecated, why supply an alternative? Is it bad enough to replace, but not enough to complain when used?
Jul 24, 2023 · Are you looking for justification for string like API fir bytes? I work on HTTP requests with python and use bytes objects and their string like methods all the time. You can see that type of usage in the twisted library for example.
Apr 9, 2023 ... Before looking at creating your own classes, it's worth taking some time to understand the classes that already exist.
Python documentation. string — Common string operations.How would the fString be included in this example from above? Parsing the formatted string as a list item obscures the fString coding (turns the iterated line into a pure string literal).
Feb 25, 2024 · This is the hub for discussion around all aspects of Python’s documentation.
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 ...
Apr 2, 2023 · Is there a way to color a string or a list/tuple ? for example something that we can do is the following: `` It’s important to understand here that the colouring done here is completely out of Python’s hands.
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.
Direct answer to your example is what g actually calls mostly doesn’t matter and only exceptions maintainer thinks are worth mentioning should be listed. Python standard library similarly sometimes calls out certain methods raise certain errors.
Oct 11, 2022 · Help please. I have to write a simple function that returns a string. The string (in this example) is a city and a country e.g. London, England I have done some other exercises where I return a formatted name e.g. Bob Johnson, but I cannot get this one right Here is my codes so far: def city_country(city_name, country_name): """Return a string value of information about a city and country ...
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 ...
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 ...
Oct 27, 2021 · A replacement can also involve multiple consecutive symbols, as viewed in one encoding, when the same binary code... So we need more information about what you expect to happen when you decode the bytes to a string. Do you also expect to encode the string back to the bytes, and do you expect it to losslessly roundtrip?
Jan 5, 2026 ... ... str.dedent() Markdown code-block style syntax for string lite ... example = d""" Example function: {code} That function was indented properly!