Loading

Paste #pjsb52s6w

  1.     # new new 2
  2.         years = set()
  3.         for variant in self.model_variants:
  4.             years.add(variant.intro_date)
  5.             years.add(variant.end_date)
  6.         years = sorted(years)
  7.  
  8.  
  9.     # new new new
  10.         years = sorted(set((variant.intro_date, variant.end_date) for variant in self.model_variants))
  11.  
  12.     # new new
  13.         years = set()
  14.         for variant in self.model_variants:
  15.             years.add((variant.intro_date, variant.end_date))
  16.         years = sorted(years)
  17.  
  18.     #new
  19.         years = set()
  20.         for dates in [(variant.intro_date, variant.end_date) for variant in self.model_variants]:
  21.             years = years.union(dates)
  22.         years = sorted(years)
  23.  
  24.         # old
  25.         years = sorted(reduce(set.union, [(variant.intro_date, variant.end_date) for variant in self.model_variants], set()))

Version history

Revision # Author Created at
pnnxdykq8 Anonymous 15 Feb 2015, 13:47:11 UTC Diff
p0bkppph9 Anonymous 15 Feb 2015, 13:44:57 UTC Diff
pswphv1ib Anonymous 15 Feb 2015, 13:37:21 UTC Diff

Comments