Methods that return multiple values can be difficult to read and prone to error. Return a small class or namedtuple
instance instead.
1def unpack_multiple_values_noncompliant():
2 # Noncompliant: uses larger number of return values
3 # making it prone to errors.
4 return 'a', 'abc', 100, [0, 1, 2]
1def unpack_multiple_values_compliant():
2 # Compliant: avoids using larger number of return values
3 # making it less prone to errors.
4 return 'abc', 100, [0, 1, 2]