On Feb 27, 5:25 pm, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: > On Wed, 27 Feb 2008 10:23:49 -0600 > > Tim Chase <[EMAIL PROTECTED]> wrote: > > > "%s=%s&%s=%s" % map(urllib.quote, params) > > Isn't map() deprecated? The above can be done with; > > "%s=%s&%s=%s" % tuple([urllib.quote(x) for x in params])
I don't think that map() is deprecated. In python 3.0 it is still present, only it returns an iterator instead of a list. In this case map(urllib.quote, params) looks for urlib.quote exactly once altogether. Whereas [urllib.quote(x) for x in params] looks for urlib.quote once for every element in params. (Of course in the example given params only has 4 elements so it doesn't matter). -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list