Suppose I have a named tuple my_tuple = collections.namedtuple( "my_tuple", ["a", "b", "c", "d", "e"], ) I want to check that the length of each value in an instance of my_tuple is equal to some constant value. Is there a way to automate that? I think I can use getattr here but I read that it's typically not good practice and violates encapsulation, though it seems reasonable in this case? Continue reading...