Dennis Lee Bieber
2/28/2010 1:58:00 AM
On Sat, 27 Feb 2010 17:41:09 -0800 (PST), "tarekamr@gmail.com"
<tarekamr@gmail.com> declaimed the following in
gmane.comp.python.general:
>
> items = [(k, v if type(v) != ListType else sorted(v)) for k,v in
> sorted(self.items()) if k != 'oauth_signature']
>
> So it there a way to convert this line to a python2.4 compliant
> syntax.
>
Without checking change notices, I'd guess you'd have to change the
generator expression "(k, v ... sorted(v))" into a list comprehension
"[k, v ... sorted(v)]"... Which /may/ result in an increase in memory
usage...
If that doesn't work, it could be the use of "sorted()"... for that
you might need to skip the existing list comprehension and use an
explicit loop with .append(), and use x.sort() on temporary copies of
the input data. (Or remove the sorted() completely; it doesn't appear to
be a requirement of that statement that data be in sorted order -- since
none of the comparisons are position relative, just inequality -- you
can sort the results later.
--
Wulfraed Dennis Lee Bieber KD6MOG
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/