About 40,400,000 results
Open links in new tab
  1. Type hinting tuples in Python - Stack Overflow

    Nov 28, 2017 · def func(var: list[int]): # do something func([1]) # would be fine func([1, 2]) # would also be fine func([1, 2, 3]) # would also be fine That's consequentially, in a way, because of …

  2. How does tuple comparison work in Python? - Stack Overflow

    Tuples are compared position by position: the first item of the first tuple is compared to the first item of the second tuple; if they are not equal (i.e. the first is greater or smaller than the …

  3. What's the difference between lists and tuples? - Stack Overflow

    Mar 9, 2009 · What are the differences between lists and tuples, and what are their respective advantages and disadvantages?

  4. python - What is a tuple useful for? - Stack Overflow

    Sep 9, 2014 · A tuple is a good way to pack multiple values into that cookie without having to define a separate class to contain them. I try to be judicious about this particular use, though.

  5. c# - How to name tuple properties? - Stack Overflow

    How and "could be" organized return from the method which returns tuple type with the name of parameters, as an example private static Tuple<string, string> methodTuple() { return new …

  6. Python type hints for function returning multiple return values

    Sep 25, 2019 · 12 Multiple return values in python are returned as a tuple, and the type hint for a tuple is not the tuple class, but typing.Tuple.

  7. c# - Tuple.Create () vs new Tuple - Stack Overflow

    Dec 13, 2014 · new Tuple<int,int>(1,2); Tuple.Create(1,2); Is there any difference between these two methods of Tuple creation? From my reading it seems to be more a convenient shorthand …

  8. python - Convert numpy array to tuple - Stack Overflow

    Apr 5, 2012 · Note: This is asking for the reverse of the usual tuple-to-array conversion. I have to pass an argument to a (wrapped c++) function as a nested tuple. For example, the following …

  9. Python typing: tuple [str] vs tuple [str, ...] - Stack Overflow

    Apr 25, 2022 · Python typing: tuple [str] vs tuple [str, ...] Asked 3 years, 7 months ago Modified 3 years, 7 months ago Viewed 8k times

  10. c# - Return multiple values to a method caller - Stack Overflow

    The tuple probably is the best option for readability. Personally, I'm not keen on having anonymous types or property names like Item1 - although I guess destructuring does mitigate …