Lazy load of strings - Ideas - Discussions on Python.org
May 11, 2025 ... The loader function is not invoked again. Error Handling: If the loader function raises an exception during evaluation, the lazy- loaded string ...
May 11, 2025 ... The loader function is not invoked again. Error Handling: If the loader function raises an exception during evaluation, the lazy- loaded string ...
Discussions on Python.org. Python Replace String in json output.Instead, parse the JSON into Python (json.loads) and modify the resulting structure and put it back. There are too many opportunities to get text replacement wrong.
Jan 5, 2026 ... The entire point of d-strings is that they make it easier to work with text blocks inside indented python code by changing the indentation logic ...
But, Python itself should provide utf8_loader, and call it whenever a string needs UCSn and has UTF-8. And it should use this pattern to implement PyUnicode_FromStringAndSize, or perhaps a new function like PyUnicode_FromValidUTF8.
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 ...
I have Python 3.11 on Windows 10. I’m still fairly new to Python. I have a string with data I got from a website. The website uses an extended ascii character for the minus sign and I’d like to change that to a normal printable dash. The next value of the odd character is \x2212.
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 ...
Discussions on Python.org. Feature Proposal: Multi-String Replacement Using a Dictionary in the .replace() Method. Ideas. HicaroD (Hicro).
Mar 22, 2024 ... Union of all its same-file subclasses. Type checkers should raise an error if a sealed class is inherited in a file different from where the ...
In an error handling code there is plenty of reasons for that, because the data might be incomplete or in an inconsistent state due to the error being handled. The idea is to allow for a “best effort evaluation” and replace failed expressions with a placeholder.
Jan 5, 2026 ... On dedenting and re-indenting replacement fields. Given this string: code = r""" def strip_each(lines): new_lines = [] for line in lines: ...
Feb 10, 2025 ... Background · Calling super in the initializer · Initializers, class factories, and __replace__ disobey LSP · Dataclasses do not easily support ...