On Thu, Jul 24, 2008 at 9:32 AM, David Kaplan <[EMAIL PROTECTED]> wrote:
>> * avoid the ternary operator, as in >> >> # Figure out label rotation. >> rotation,nlc = cs.calc_label_rot_and_inline( >> slc, imin, lw, lc if self.inline else [], >> self.inline_spacing ) >> >> since this requires python2.5. I replaced this, and a similar >> construct in contour.py, so please make sure I did the right thing >> > > The reason I used this was that I saw the following line in contour.py > (line 325): > > lc = [tuple(l) for l in linecontour] > > Doesn't this also require 2.5 or is the if different than the for? > Should this also be changed? No, this (a list comprehension) is fine. The problem is the ternary operator " lc if self.inline else []" which is not supported in python 2.4. I believe all the python 2.5isms have been removed. >> def func(x=None): >> if x is None: x = [] >> >> I have fixed this in contour.py >> > > I don't really understand how this can be a problem, but it probably > isn't that important unless you feel like enlightening me. See for example http://www.velocityreviews.com/forums/t350126-default-argument-to-init.html ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel