Skip to main content
Post Undeleted by Ricardo Cárdenes
Even better
Source Link
Ricardo Cárdenes
  • 9.1k
  • 1
  • 22
  • 34

In the context ofOk, if your functions are stateless, but still expect an iterable as argument, and that's the whole problem, then this should do:

a,for bsi =in zip(*((si['a'],s:
 si['b']   a([si['a']]) 
 for si in s)b([si['b']])

In the context of your problem:

a, b = zip(*((si['a'], si['b']) for si in s))

Ok, if your functions are stateless, but still expect an iterable as argument, and that's the whole problem, then this should do:

for si in s:
    a([si['a']]) 
    b([si['b']])
Post Deleted by Ricardo Cárdenes
Source Link
Ricardo Cárdenes
  • 9.1k
  • 1
  • 22
  • 34

In the context of your problem:

a, b = zip(*((si['a'], si['b']) for si in s))