Please help, possible combination of 1, 2 and 3 - Python Discussions
Dec 26, 2020 ... I am a bit confused about why my code is not running properly. I want to print out all of the possible combinations of 1, 2 and 3. For
Dec 26, 2020 ... I am a bit confused about why my code is not running properly. I want to print out all of the possible combinations of 1, 2 and 3. For
Take this example, assuming that ReturnType refers to the return type of the enclosing function or method, this should type check just fine. from typing import List, Union.
Oct 11, 2025 ... Over the years of using Python, I've repeatedly come across a code formatting issue that I find quite distracting, although it seems to be ...
I prefer the parameters of a function (with their documentation) to be listed explicitly in the function’s documentation. This is in contrast with man-style, which describes the positionals in prose. Compare open (what I call man-style) with numpy.linalg.norm (what I say employs an explicit list).
Oct 8, 2022 ... So, currently “import X” python code allows “level 1” import loops ... type or reference to a function is actually instantiated or called).
For example, the following function using variadic type transformationsI’ll note that in this example, the first overload is problematic because a return type of Never does not imply that the overload is invalid. It simply means that if it’s called, it won’t return control back to the caller.
Dec 18, 2022 ... I propose specifying a function parameter as being pass-by-reference, using the notation “&name” instead of “name”.
STR_TYPE: TypeForm[str] = str # variable type. this case especially when it also does TypeForm[str] instead of TypeForm[T]. I lean that TypeForm should not be allowed for variable types or we need examples/library use cases where allowing it for variables is valuable.
Mar 28, 2019 ... already using the "/" notation in their interfaces. ... For example, let's say we want to create a function that converts ...
Perhaps an approach would be: either the types should be actual Python types with pipes for alternation, so the entire annotation is Python code in monospace; or the types should be presented prosaically in proportional type. It’s the authors’ choice which to use.
Dec 3, 2025 ... x: list[int] = [1,2,3] def foo() -> list[int]: return x def bar ... Your example shows how problems arise from keeping a reference to ...
Jan 5, 2026 ... ... function definitions by allowing parenthesized parameter lists, type parameters and return type annotations. So I am +1 on that. However, I ...