I am doing some validation of the input data of one program I have created. I am doing this with assert. If assertion arises I want to know in which part of the data occurs so I want to get the value that arises the assertion.
assert all(isinstance(e, int)
for l1 in sequence.values()
for l2 in l1 for e in l2),"Values of the dictionnary aren't lists of integers. Assert found in '{l2}'"
# This code doesn't work