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 ...
In contrast, the argument for doing something similar in decorators felt more like how decorators are placed in code, and keeping that connection. So it would be best to see real examples to make the case for tag strings.
Apr 9, 2023 ... ... replace(" ", "_") movies[key] = movie(title, director, year) ... The RFC is for how I've coded this and is it a good example of, not ...
This example is carefully constructed so that it doesn’t actually do anything that depends on the type of my_set. If you return my_set, or pull an element out of it and try to do “integer” things with it, all of those would still, correctly, be a type error.
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 ...
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.
Mar 31, 2022 ... And many other popular programming languages, including Node.js, Go, Rust, and Java uses UTF-8 by default. Changing the default encoding to UTF- ...
Syntax of the method: str.replace(old, new, count=-1). What if replace could accept two lists instead of two strings. Often I find in code: text.replace(a, b).replace(c, d).
Apr 2, 2019 ... Trying to use a cancel scope or nursery inside an async generator is a natural thing that people often try. The resulting errors are hard to ...
But Python has many kinds of strings. How should the following program be type checked?f-strings are too dynamic and should not be allowed in annotations. All type checkers should reject them. Pytype currently allows them, at least in this simple example.
Sep 16, 2025 ... _day + elif day < 0: + day = _days_in_month(year, month) + 1 + day return type(self)(year, month, day) __replace__ = replace @@ -2090,6 +2092,8 ...
Feb 25, 2020 ... For example, if europe_berlin_pkl is a string containing a pickle ... The PYTHONTZPATH option should be a string delimited by os.pathsep ,