[EMAIL PROTECTED] wrote: >>>> "".join(map(lambda x,y: {True:x, False:"0"}[y], _cmykMap, >[True, False, True, True])) >'C0YK' >but I'd break that down into a selector function (rather than a >lambda) or something to make it readable, since it's way too far on >the lisp side of things as far as expressiveness goes.
But very interesting for someone like me who never learned to think "functional". ;-) >The code you have isn't actually unclear, so consider *why* you want >to make it compact. I like to have elegant code (hoping it will be faster, too) and I like to learn "how the pros do it". >What I don't see is why you have ProcessColors as a class, but I'm >assuming there's context for that The real class has some more methods, and the two converters are only private. But you're right - I use the class here merely for grouping everything that belongs together; I'm not really used to OO at all - I used to code in Perl and now try to learn Python and OO at once. ;-) > these converter functions are >just that, functions, though I could see having a color object that >also called them as methods, the idea of using a method of a color >object to convert another color word in a way that has nothing to do >with the color object itself seems an odd use of the object. I thought, my 'color info object' should 'know' how to present itself to different interfaces. Best regards, ----------------------- Henning Hraban Ramm Südkurier Medienhaus / MediaPro Abt. Systembetreuung _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig