Top "Tuples" questions

In programming, tuples are simple *product types*, representing ordered collections of types.

What's the meaning of "(1,) == 1," in Python?

I'm testing the tuple structure, and I found it's strange when I use the == operator like: >>> (1,) == 1, Out: (…

python tuples equals-operator
Is there way to create tuple from list(without codegeneration)?

Sometimes there are needs to create tuples from small collections(for example scalding framework). def toTuple(list:List[Any]):scala.…

scala tuples iterable-unpacking
.NET 4.7 returning Tuples and nullable values

Ok lets say I have this simple program in .NET 4.6: using System; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { …

c# tuples .net-4.7
How does std::get work?

After trying to make a std::get<N>(std::tuple) method myself, I'm not so sure how it's …

c++ templates c++11 tuples stdtuple
Two variables in Python have same id, but not lists or tuples

Two variables in Python have the same id: a = 10 b = 10 a is b >>> True If I take …

python python-3.x tuples identity python-internals
Using a std::tuple as key for std::unordered_map

With the code below, I get a very confusing error in MSVC that seems to suggest the key type (an …

c++ stl compiler-errors tuples unordered-map
Checking if specific tuple exists in table

Is there a way to check if a specific tuple exists in a table in a where-in statement? Something like: …

sql sqlite tuples where-in
Python: Unpacking an inner nested tuple/list while still getting its index number

I am familiar with using enumerate(): >>> seq_flat = ('A', 'B', 'C') >>> for num, entry …

python list tuples enumerate iterable-unpacking
How to return an unpacked list in Python?

I'm trying to do something like this in python: def f(): b = ['c', 8] return 1, 2, b*, 3 Where I want f to …

python return tuples unpack
How to use c# tuple value types in a switch statement

I'm using the new tuple value types in .net 4.7. In this example I am trying to make a switch statement …

c# switch-statement tuples c#-7.0