Fredrik Lundh wrote: > Brian Sabbey wrote: >> doFoo(**): >> def func1(a, b): >> return a + b >> def func2(c, d): >> return c + d >> >> That is, a suite can be used to define keyword arguments. > > > umm. isn't that just an incredibly obscure way to write > > def func1(a, b): > return a + b > def func2(c, d): > return c + d > doFoo(func1, func2) > > but with more indentation?
Brian's suggestion makes the code read more like an outline. In Brian's example, the high-level intent stands out from the details, while in your example, there is no visual cue that distinguishes the details from the intent. Of course, lambdas are even better, when it's possible to use them: doFoo((lambda a, b: a + b), (lambda c, d: c + d)) Shane _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com