D-string vs str.dedent() - Ideas - Discussions on Python.org
Oct 11, 2023 ... Python was one of first programming languages that added support of triple-quoted string literals. Since then, the support of them has been ...
Oct 11, 2023 ... Python was one of first programming languages that added support of triple-quoted string literals. Since then, the support of them has been ...
Mar 27, 2024 ... The goal is to create a Python method that takes an unindented string ... ) Build and test regex with flavors like PCRE, Python, Golang, Java 8, .
Discussions related to the Python Programming Language, Python Community, and Python Software Foundation operations.
The __add__ method Numpy arrays performs elementwise addition. For Python lists, it performs concatenation. However, the docstrings don't tell us about this. The docstrings describe how __add__ is called rather than wh…
Jan 5, 2026 ... Resulted in this: >>> print(example) Example function: def strip_each(lines): new_lines = [] for line in lines: new_lines.append(line ...
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.
Aug 21, 2025 ... ... str__ method. The ... Python does not have a traditional switch-case statement like some other programming languages (e.g., C, Java).
Conversion to Python strings requires calling .UTF8String or similar methods, forcing eager loading. This is incorrect. PyObjC transparently translates NSString instances to a subclass of str.
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.
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 am concerned about LLM code in PythonIs this a secure way to generate deterministic secrets in...
Hi all! I work with Python and JavaScript pretty often and the thing that trips me up when switching between the two is the use of key-value pairs. JavaScript objects allows plain text keys (which are strings under the hood), and I think that's a reasonable assumption which saves a lot of key strokes. I believe Python could benefit from something similar: regular_dict = { 'name': 'Python ...
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.
Subclassing as documented in the tutorial currently does not work with strings.Here’s a Python 3.12+ extension module mymod that defines a type MyStr with settable attributes number (int) and flag (bool), and a get_data method, without using PyUnicodeObject et. al.
I think I learned it from the official Python tutorial where it was introduced early on before even functions. I use slicing with strings quite often to get e.g. the first or last part of a string.
Oct 10, 2020 ... For example in my api I have obj1.within(obj2) if obj1 is an ... <built-in method upper of str object at 0x7f8cbea663b0>. Now I know I ...
Switch datetime docstrings / documentation to using "Returns" rather than "Return"? · Issue #91363 · python/cpython · GitHub StackOverflow Discussion on Python docstings Other conventions: Emacs Manual recommends the imperative Julia recently (2022) uses Return over Returns Oracle Java style guide requires descriptive Other discussions:
Oct 17, 2023 ... In Java they decided to trim trailing whitespaces, and they already had an experiance of Python and other programming languages. Therefore ...