interpreter: use zip function

Currently this is implemented as range(min(len(a), len(b)), an then
indexing into a and b to get what we actually want. Fortunately python
provides a function called zip that just does this.
pull/5259/head
Dylan Baker 6 years ago committed by Jussi Pakkanen
parent 2499e25476
commit 00a3bb8d69
  1. 4
      mesonbuild/interpreter.py

@ -2278,9 +2278,7 @@ external dependencies (including libraries) must go to "dependencies".''')
if argcount != len(args):
raise InvalidArguments('Expected %d arguments, got %d.' %
(argcount, len(args)))
for i in range(min(len(args), len(arg_types))):
wanted = arg_types[i]
actual = args[i]
for actual, wanted in zip(args, arg_types):
if wanted is not None:
if not isinstance(actual, wanted):
raise InvalidArguments('Incorrect argument type.')

Loading…
Cancel
Save